Basic table
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | — | Must be "table" |
id | string | No | — | Unique identifier. Auto-generated if not provided. Max: 100 chars. |
headers | array | No | — | Header row cells. Max: 20 cells. |
rows | array | No | — | Data rows. Each row is an array of cells. Max: 100 rows, 20 cells per row. |
dataSource | string | No | — | Bind to a table variable instead of inline rows. See Variable data binding. |
mapping | string[] | No | — | Column keys to select from the data source. Max: 20 items. |
caption | string | No | — | Caption text for table numbering (e.g., "Revenue by quarter"). Max: 500 chars. |
anchor | string | No | — | Anchor ID for internal references (e.g., "tab-revenue"). Pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$. Max: 100 chars. |
invisible | boolean | No | false | Hide all borders and backgrounds (borderless table). |
hideHeaders | boolean | No | false | Hide the header row. |
style | object | No | — | Inline table style override. See Table style. |
spacing | object | No | — | Spacing override with before and after in pt (0–100). |
Cell format
Each cell inheaders and rows can be either a simple string or a cell object:
Simple string:
Cell object properties
| Property | Type | Description |
|---|---|---|
text | string | Cell text content. Max: 1000 chars. Supports {{varName}} substitution. |
image | object | Embedded cell image (see below). |
align | string | Cell alignment: "left", "center", or "right" |
Cell image properties
| Property | Type | Description |
|---|---|---|
src | string | Image URL. Max: 2000 chars. |
caption | string | Alt text. Max: 200 chars. |
width | number | Width in px (10–1000). |
height | number | Height in px (10–1000). |
When a cell contains exactly one
{{varName}} reference that resolves to an image variable, the cell is automatically rendered as an image. See Variables — Image variables in table cells.Variable data binding
Instead of definingrows inline, bind a table to a table variable via dataSource. Use mapping to select and reorder columns.
mapping is provided, only the specified columns (matched by name against the variable’s columns) are included. Without mapping, all data columns are used as-is.
Table style
Override the default table styling inline via thestyle property. This has the same structure as defaults.styles.table.
Full table style properties
Full table style properties
borders.outer / borders.inner
header
rows
cellPadding
| Property | Type | Description |
|---|---|---|
width | number | Border width in pt (0–10). |
color | string | Border color in hex. |
style | string | "solid", "dashed", or "dotted" |
| Property | Type | Description |
|---|---|---|
backgroundColor | string | Header background color in hex. |
color | string | Header text color in hex. |
fontSize | number | Header font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
fontStyle | string | "normal" or "italic" |
align | string | "left", "center", or "right" |
| Property | Type | Description |
|---|---|---|
backgroundColor | string | Row background color in hex. |
alternateBackgroundColor | string | Alternate row background for striped tables. |
color | string | Row text color in hex. |
fontSize | number | Row font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
fontStyle | string | "normal" or "italic" |
align | string | "left", "center", or "right" |
| Property | Type | Description |
|---|---|---|
top | number | Top padding in pt (0–50). |
right | number | Right padding in pt (0–50). |
bottom | number | Bottom padding in pt (0–50). |
left | number | Left padding in pt (0–50). |
Captions and anchors
Add acaption for automatic table numbering and an anchor for cross-referencing.
defaults.styles.tableCaption. See Defaults — Table caption style.
Defaults
Tables without an inlinestyle inherit from defaults.styles.table:
