Grid¶
Info
New in Atfinity 18.
A <grid> is a layout element that divides the page width into equal columns and places content on them.
Each piece of content goes into a <cell>, which sets where it starts (column and row) and how many
columns and rows it covers (colWidth and rowHeight).
Because cells can cover different numbers of columns and rows, a grid can arrange content of different sizes next to
each other.
It can only be used within a <body>.
Example¶
<grid columns="6" rowHeight="6mm" gap="3mm">
<cell column="0" row="0" colWidth="6" rowHeight="2">
<text><b>Account statement</b></text>
</cell>
<cell column="0" row="2" colWidth="3" rowHeight="3">
<text><b>Account holder</b></text>
<text>Jane Doe</text>
</cell>
<cell column="3" row="2" colWidth="3" rowHeight="3">
<text><b>Account</b></text>
<text>CH93 0076 2011 6238 5295 7</text>
</cell>
</grid>
Attributes¶
<grid>¶
columns (optional)¶
The number of columns the width is divided into. Default is 6.
rowHeight (optional)¶
The height of one row in pt, mm or cm, e.g. rowHeight="6mm". Default is 14.
gap (optional)¶
The space between columns and between rows in pt, mm or cm. Default is 6.
cellPadding (optional)¶
The padding of the cells.
Behaves like the css property padding, so you can give values in the TRouBLe notation.
Defaults to "3 6".
borderColor (optional)¶
The color of the cell border.
Can be a named color or RGB value.
Default is #e8e8e8.
borderWidth (optional)¶
The width of the cell border in points (pt). Default is 1.
spaceBefore (optional)¶
Space before the grid in pt, mm or cm.
spaceAfter (optional)¶
Space after the grid in pt, mm or cm.
A <grid> can only contain <cell>.
<cell>¶
column and row (optional)¶
The column and row of the top left corner of the cell, counted from 0. Default is 0.
colWidth and rowHeight (optional)¶
The number of columns and rows the cell covers. Default is 1.
Content that does not fit in a cell is scaled down. A cell is never split across two pages, so a cell cannot be taller than a page. Cells that cover the same rows stay on the same page.