# 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: 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:

```
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>
```

The question should be specific, self-contained, and written in natural language.
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.
