Rows, columns, and cells
The Row, Column and Cell children of a table — track sizes, AutoGrow and KeepWithNextRow, the column:row address, merged cells, insets, fills and strokes.
A table's <Row> and <Column> children size its tracks; its <Cell> children hold the content and most of the formatting.
In short A <Column> carries a width. A <Row> carries a height, a minimum and maximum,
and whether it grows with its content (AutoGrow) or must stay with the next row
(KeepWithNextRow). Both are named by their zero-based index. A <Cell> names its grid position
as Name="column:row", can span rows and columns to merge, holds ordinary paragraphs, and
carries its own insets, fill, edge strokes, vertical justification, rotation and diagonal lines.
A three-row, two-column table: <Row> and <Column> give the tracks, and each <Cell>
holds a one-word paragraph.
Columns
| Attribute · Column | Values | Paged | paged.set |
|---|---|---|---|
| Name | integer | read · written | |
| SingleColumnWidth | length (pt) | read · written | columns[i].width |
Columns are listed left to right. Name is the column's zero-based index, the first half of a
cell's address, and SingleColumnWidth its width in points.
Rows
| Attribute · Row | Values | Paged | paged.set |
|---|---|---|---|
| Name | integer | read · written | |
| SingleRowHeight | length (pt) | read · written | rows[i].height |
| MinimumHeight | integer / real | read · written | |
| AutoGrow | false | read · written |
Rows are listed top to bottom across all regions: header rows first, then body, then footer.
Name is the row's zero-based index across the whole table. With AutoGrow on (the default), a
row is at least MinimumHeight tall and grows to fit its tallest cell, up to MaximumHeight.
With AutoGrow="false" the row stays at its set height whatever its cells hold, and text that
does not fit a cell is overset in that cell.
KeepWithNextRow="true" keeps a row in the same frame as the row after it, so a table never breaks
between them. StartRow forces a row to begin in the next column, frame or page.
In Paged: row heights,
AutoGrowandKeepWithNextRoware honoured, matched against InDesign: a fixed row keeps its height and oversets the lines that do not fit.StartRowis not read yet. Supported · verified
Cells
Address and span
| Attribute · Cell | Values | Paged | paged.set |
|---|---|---|---|
| Name | text | read · written | |
| RowSpan | number (count) | read · written | rowSpan |
| ColumnSpan | number (count) | read · written | columnSpan |
| AppliedCellStyle | CellStyle reference | read · written | appliedCellStyle |
Name is the cell's address: column index, a colon, row index, both zero-based, so the cell in
column 1 of row 0 is Name="1:0". InDesign lists cells column by column, but the address, not the
order, places a cell. A cell with ColumnSpan="2" covers its own column and the next; a cell with
RowSpan="3" covers its row and the two below. The positions it covers have no <Cell> of their
own.
In Paged: spans are honoured. A row-spanning cell that needs more height than its rows give adds the shortfall to the last row it spans. Supported · verified
Insets and text
A cell's content is ordinary text: one or more <ParagraphStyleRange> children, with their own
<Br/> marks, exactly as in a story. A cell can even hold a table.
| Attribute · Cell | Values | Paged | paged.set |
|---|---|---|---|
| TextTopInset | length (pt) | read · written | cellInsetTop |
| TextLeftInset | length (pt) | read · written | cellInsetLeft |
| TextBottomInset | length (pt) | read · written | cellInsetBottom |
| TextRightInset | length (pt) | read · written | cellInsetRight |
| VerticalJustification | TopAlign | CenterAlign | BottomAlign | JustifyAlign | read · written | cellVerticalJustification |
| RotationAngle | integer | read · written | |
| MinimumFirstBaselineOffset | integer | read | |
| ClipContentToCell | false | not read |
The four insets pad the text from the cell's edges. VerticalJustification places the text
(TopAlign, CenterAlign, BottomAlign, JustifyAlign). RotationAngle turns the content by
90, 180 or 270 degrees; the borders and fill do not turn. FirstBaselineOffset and
MinimumFirstBaselineOffset place the first line, as in a text frame. ClipContentToCell clips
content that overflows the cell.
In Paged: a cell is composed like a small text frame. Insets come from the cell's own attributes, not from its cell style. Vertical justification and rotation are applied. The first line is placed one ascent below the top inset, and each later paragraph one leading below the one before; a cell's
Supported · verified Supported · verified Supported · verifiedFirstBaselineOffsetis read but not used yet.
Fill and edge strokes
| Attribute · Cell | Values | Paged | paged.set |
|---|---|---|---|
| FillColor | Color / Swatch reference | read · written | cellFillColor |
| FillTint | integer | not read | |
| TopEdgeStrokeColor | Color / Swatch reference | read · written | cellTopEdgeStrokeColor |
| TopEdgeStrokeWeight | length (pt) | read · written | cellTopEdgeStrokeWeight |
| TopEdgeStrokeTint | number (percent) | read · written | cellTopEdgeStrokeTint |
| TopEdgeStrokeType | StrokeStyle reference | read · written | |
| TopEdgeStrokeGapColor | Color reference | not read |
FillColor and FillTint paint the cell's background. Each edge (Top…, Bottom…, Left…,
Right…) has a colour, weight, tint, stroke type and gap colour. When a table style's dividers
apply, InDesign writes the resulting stroke on each cell's matching edge, so these edge attributes
are what most often draws a table's grid. A value on the cell wins over its cell style.
In Paged: the fill colour and the edge strokes are drawn, each edge in its stroke style (a double line as two rules, dotted styles as dots, other styles solid). A cell's
Supported · verifiedFillTintis not modelled: a tinted fill shows at 100 %. Edge gap colours are not painted.
Diagonal lines
LeftLineDrawn draws the diagonal from the top-left to the bottom-right corner and
RightLineDrawn the one from top-right to bottom-left, each with its own …StrokeColor,
…StrokeWeight and …StrokeTint. DiagonalLineInFront puts the lines over the content instead
of behind it.
In Paged: diagonal lines are drawn with their tints and front or back order.
Supported · verified
Frequently asked questions
How does a <Cell> know its grid position?
From Name="column:row", both zero-based. The order in which cells are listed does not matter.
How are merged cells written?
As one <Cell> with RowSpan or ColumnSpan above 1. The grid positions it covers have no cell
element of their own.
What does AutoGrow="false" do?
It fixes the row at its set height. Text that does not fit a cell in that row is overset in the
cell instead of making the row taller.
Where does a cell's padding come from?
From its TextTopInset, TextLeftInset, TextBottomInset and TextRightInset attributes, or
from its cell style's insets when the cell sets none.
The table model
The Table element — the row and column counts that define the grid, the table style, header and footer rows, the outer border and the dividers.
Tables in the text flow
How a table sits in a story as its own paragraph's content, ends with that paragraph's Br, breaks across threaded frames, repeats headers and oversets.