> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-split-field-values-into-individual-cells.md).

# How To: Split Field Values into Individual Cells

Use `toCells` when a form needs one character per box.

### Problem

You need to display each character of a field in its own table cell.

### Solution

**Basic implementation:**

```
<table>
  <tr>
    <td>{{!Opportunity.Product_Code__c toCells="5,codeCell"}}</td>
  </tr>
</table>
```

**Input:** `ABC12`\
**Output:** `|A|B|C|1|2|`

### With Custom Styling

```
<style>
.codeCell {
  border: 1px solid #000;
  padding: 8px;
  text-align: center;
  width: 40px;
  font-family: monospace;
  font-size: 16px;
}
</style>

<table style="border-collapse: separate; border-spacing: 5px;">
  <tr>
    <td colspan="5"><strong>Enter Code:</strong></td>
  </tr>
  <tr>
    <td>{{!Opportunity.Verification_Code__c toCells="5,codeCell"}}</td>
  </tr>
</table>
```

### Practical Example: ZIP Code

```
<style>
.zipCell {
  border: 2px solid #333;
  padding: 10px;
  text-align: center;
  width: 35px;
  font-weight: bold;
  background-color: #f9f9f9;
}
</style>

<p>ZIP Code:</p>
<table style="border-collapse: collapse;">
  <tr>
    <td>{{!Account.BillingPostalCode toCells="5,zipCell"}}</td>
  </tr>
</table>
```

### Tips

* Use this inside `<td>` tags.
* The first parameter is the number of cells.
* The second parameter is the CSS class name.
* Short values leave blank cells.
* Long values are truncated.
* This is useful for postal codes, serial numbers, and verification codes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/advanced-template-logic/template-attributes/template-attributes-how-to-guides/how-to-split-field-values-into-individual-cells.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
