# Sections / Tables

Sections could be used to show dynamic repeatable items usually to fill Table data with multiple columns.

#### Syntax:

```
{#[sectionName].[propertyName]} 
Examples: {#people.name}, {#people.age}

{#[fieldType][sectionName].[propertyName]} 
Examples: {#%people.photo}, {#*people.html}, {#!people.markdown}, {#&people.link}
```

For each section item and property passed during document generation service will automatically add additional rows to sheet and shift all the cell content down below the section cell.

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2F1iYp2TdSb1kHDAyYSmFH%2Fimage.png?alt=media&#x26;token=778914ab-06c5-44c5-a24d-1b16d3848b26" alt="" width="375"><figcaption><p>Template</p></figcaption></figure>

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FerLHUD78KHtPdJzSUnbZ%2Fimage.png?alt=media&#x26;token=55848dde-9014-4709-92a8-83096fc62984" alt="" width="307"><figcaption><p>Output</p></figcaption></figure>

### Formulas

You can use formulas in your sheets that refer to individual cells or table columns using relative references or named table columns. Examples:

#### Formula example in dynamic table row with named table column reference

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FYPhXamG5AzK0XjG69Obb%2Fimage.png?alt=media&#x26;token=714cc68d-377b-46d4-8990-7790d515617a" alt=""><figcaption></figcaption></figure>

#### Formula example in regular dynamic row with relative reference

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2F0HGj8gCH8Hm8dHLvf1Lg%2Fimage.png?alt=media&#x26;token=e0321263-6c30-4ad8-a520-adaf2570cf80" alt=""><figcaption></figcaption></figure>

**If you provide multiple products new rows will be added to spreadsheet, additionally:** <br>

* The 'Cost with Tax' column with a formula will be copied to new rows, and the **formula will automatically adjust to reflect the updated relative cell references** (B4, B5, B6, etc.)
* The 'Tax' column with a static value (along with any other cells containing content in the same row) will be copied to new rows as-is.

#### Formula for table data summaries

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FJeKsdScpOzJ2bwOjusW4%2Fimage.png?alt=media&#x26;token=f26172fd-f43d-4ed0-8de8-3f6acc00750d" alt=""><figcaption></figcaption></figure>

* Use named tables to easily reference entire columns of dynamically populated table data in summary formulas.

It is not always easy to build formulas that refer to all cells in a table—such as summing all rows—when the exact number of rows or columns is not known in advance.

**Best Practices for Using Tables with Placeholders in Templates**

* **Use named Excel tables**: Define your tables using Excel’s *Insert Table* feature. When a placeholder inside a named table expands rows or columns, the table range automatically updates to include the new data.
* **Reference table data using structured references**: Take advantage of structured table references in formulas (e.g., `=SUM(TableName[ColumnName])`) to dynamically refer to entire columns, even as the table grows or shrinks.

#### Optional Columns

If you use named tables with placeholders in the header and content cells, and no value is provided (or the value is empty), those columns will be skipped in the output document. The table range will be automatically adjusted accordingly.

<figure><img src="https://1713720388-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRMYKAUZ0NsaDRvNONC3%2Fuploads%2FPFX1fzGfzTJEykkiP80H%2Fimage.png?alt=media&#x26;token=0f3acb12-642d-46ab-9a17-6bd9ef109d6c" alt=""><figcaption></figcaption></figure>

#### Short Definition

If you have just one table/section in your document template you can use shorter placeholder definition. **If you skip section name it will be assumed as "Items"**

```
{#name} is shorter version of {#Items.name}
{#age} is shorter version of {#Items.age}
```
