Work in progress — this reference is being written in the open. Unfinished pages are excluded from search engines.
Paged · IDML Reference
Styles

Table and cell styles

The TableStyle and CellStyle elements — how a table style nominates a default cell style per region and sets its border strokes and alternating fills, and how a cell style carries per-edge strokes and fill.

Pro· reference

Tables get two style kinds: a cell style formats one cell, and a table style sits above it, nominating a default cell style per region and dressing the table itself.

In short: A cell style formats a single cell — its fill, its four edge strokes, its vertical justification. A table style sits a level above it: it nominates a default cell style for each region of the table (header, body, footer, and the left and right columns) and carries the table's own border strokes and alternating-row fills. <TableStyle> lives in <RootTableStyleGroup> and <CellStyle> in <RootCellStyleGroup>; both cascade through BasedOn with the same first-setter-wins fold as the text styles. For the table structure these styles dress — rows, columns, header and footer regions, merged cells — see the Tables chapter.

Tables get their own two style kinds. A cell style formats a single cell — its fill, its four edge strokes, its insets. A table style sits a level above: it nominates a default cell style for each region of the table (header, body, footer, and the left / right columns) and carries the table's own border strokes and alternating-row fills. Both cascade through BasedOn and resolve with the same first-setter-wins fold described in the cascade. For the table structure these styles dress — rows, columns, header/footer regions, merged cells — see the Tables chapter.

Where they live

<TableStyle> lives in <RootTableStyleGroup> and <CellStyle> in <RootCellStyleGroup> (each with optional intermediate group nesting the parser flattens). A <Table> names its table style with AppliedTableStyle="…"; a <Cell> names its cell style with AppliedCellStyle="…".

TableStyle

A table style's region attributes are references to cell styles — the cell style to apply to cells in that region unless the cell overrides it. The border-stroke attributes (Swatch/None normalises to unset) and the start/end alternating-fill attributes paint the table itself.

Attribute · TableStyleType / valuesSupportNotes
Selfstring idSupportedThe style id. What a table references via AppliedTableStyle.
NamestringParsed, not yet renderedHuman-readable name; resolution keys on Self.
BasedOnstring idSupportedParent table style, or the [No table style] default. Attribute or <BasedOn> Properties child.
BodyRegionCellStylestring (CellStyle id)SupportedCell style for body cells (everything outside header/footer/columns).
HeaderRegionCellStylestring (CellStyle id)SupportedCell style for header-row cells.
FooterRegionCellStylestring (CellStyle id)SupportedCell style for footer-row cells.
LeftColumnRegionCellStyle / RightColumnRegionCellStylestring (CellStyle id)SupportedCell styles for the leftmost / rightmost column regions.
TopBorderStrokeColor / BottomBorderStrokeColor / LeftBorderStrokeColor / RightBorderStrokeColorstring (swatch id)SupportedPer-edge table-border paint. "Swatch/None" normalises to unset.
TopBorderStrokeWeight / … / RightBorderStrokeWeightdouble (pt)SupportedPer-edge table-border weight in points.
StartRowFillColor / StartRowFillCount / StartRowFillTintswatch id / int / doubleSupportedThe "starting" alternating-row fill: colour, how many consecutive rows take it, and its tint.
EndRowFillColor / EndRowFillCount / EndRowFillTintswatch id / int / doubleSupportedThe alternating "end" fill that follows the starting run.

(crates/paged-parse/src/styles.rs defines TableStyleDef, mirrored above.)

The StrokeOrder attribute — which strokes win at a crossing (RowOnTop, ColumnOnTop, BestJoins, Indesign2Compatibility) — and the gap-colour, skip-alternating, and column-fill families are stored by IDML on <TableStyle> but are not yet read here. Not yet parsedStrokeOrder, gap colours, column fills, skip-alternating counts

CellStyle

A cell style carries the fill, four per-edge strokes, and vertical justification a cell falls back on when its own attributes are absent. Colour attributes set to Swatch/None normalise to unset for the cascade.

Attribute · CellStyleType / valuesSupportNotes
Selfstring idSupportedThe style id. What a cell references via AppliedCellStyle, and what a TableStyle region attribute points at.
NamestringParsed, not yet renderedHuman-readable name; resolution keys on Self.
BasedOnstring idSupportedParent cell style, or the [None] default. Attribute or <BasedOn> Properties child.
FillColorstring (swatch id)SupportedCell background fill. "Swatch/None" normalises to unset.
VerticalJustificationstring (e.g. TopAlign, CenterAlign, BottomAlign)SupportedVertical placement of the cell's content.
TopEdgeStrokeColor / BottomEdgeStrokeColor / LeftEdgeStrokeColor / RightEdgeStrokeColorstring (swatch id)SupportedPer-edge cell-border paint. "Swatch/None" normalises to unset.
TopEdgeStrokeWeight / … / RightEdgeStrokeWeightdouble (pt)SupportedPer-edge cell-border weight in points.

(crates/paged-parse/src/styles.rs defines CellStyleDef, mirrored above.)

The cell insets (TopInset, LeftInset, BottomInset, RightInset), the AppliedParagraphStyle the cell's text starts from, diagonal lines, and gap colours are stored by IDML on <CellStyle> but are not yet read here — cell padding today comes from the cell element rather than its style.

Not yet parsedCell insets, AppliedParagraphStyle, diagonal lines, gap colours on CellStyle

How a cell's effective formatting is built — its own attributes, then its cell style's chain, then the table style's region default — follows the same layered logic as text; see conflict resolution.

Frequently asked questions

What is the difference between a table style and a cell style? A cell style formats a single cell — its fill, four edge strokes, and vertical justification. A table style sits above it: it nominates a default cell style for each region of the table and carries the table's own border strokes and alternating-row fills.

How does a table style apply formatting to different parts of a table? Its region attributes — BodyRegionCellStyle, HeaderRegionCellStyle, FooterRegionCellStyle, and the left and right column region attributes — are references to cell styles, naming the cell style to apply to cells in that region unless a cell overrides it.

How do a table and a cell reference their styles? A <Table> names its table style with AppliedTableStyle and a <Cell> names its cell style with AppliedCellStyle; each value is the style's Self id.

Are there table or cell style attributes the parser does not yet read? Yes. On <TableStyle>, StrokeOrder, gap colours, column fills, and skip-alternating counts are stored but not yet read; on <CellStyle>, the cell insets, AppliedParagraphStyle, diagonal lines, and gap colours are not yet read — cell padding today comes from the cell element rather than its style.

On this page