--- title: "Filling tables with array data" description: "Fill tables with repeating array data in Docmosis templates, controlling layout, page breaks, headers, and row grouping for well-formatted documents." canonical_url: "https://resources.docmosis.com/template-tutorials/tables" last_reviewed: 2026-06-08 --- # Filling tables with array data This example shows you how to use tables to display repeating data (eg: objects in an array). By setting different table properties and paragraph properties you can control how the table lays out on the page when it is filled with data. ### Filling a table with data The first row marked \<\> | | | | -------------- | - | - | | < > | < > | < > | | < > | | | **Setting Table Properties** | | The table below has: | |---|---| | This row will always appear as a Header Row. | | ------------------------------------------ | | <
- “Allow row to break across pages” - deselected for every row.
- “Repeat as header row at the top of each page” – selected for the first row.
- When the table is filled with data it will extend over the page.
> | | Everybody knows that
<> the < >
is <> | | < > | **Built-in variables for numbering rows** | Type | Value of “rowidx” | Value of “rownum” | | ------------- | ----------------- | ----------------- | | < > | | | | < > | <<$rowidx>> | <<$rownum>> | | < > | | | **Setting Paragraph Properties** | | The table below has the Paragraph Property:
- “Keep with next” - selected for the cells in row A.
- “Keep with next” – deselected for all the other cells.
This will ensure that row A “sticks” with row B if the table breaks over a page.
| |---|---| | A table that runs over the page | | | | ------------------------------ | - | - | | <> | | | | A | I want to keep the (A) row | < > | | B | With the (B) row | < > | | < > | | | *Note: This example was set-up so that when the table is filled with data, even though there is enough room for the A row with “Miss Piggy” to fit on the bottom of the table on the previous page, it has been pulled on to the this page. The “Keep with next” property will ensure that it “sticks” to the B row.* ```