paged.IDML Reference
Tables

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.

Tier: ProProIIIreference

The <Table> element declares a table's grid with counts and carries the table's own border and dividers as attributes.

In short A <Table> defines its grid with HeaderRowCount, BodyRowCount, FooterRowCount and ColumnCount, and its <Row>, <Column> and <Cell> children fill the grid in. The table can apply a table style (AppliedTableStyle) and set its own outer border, one set of attributes per edge, and alternating row and column dividers. Every stroke has a colour, weight, tint and stroke type, and patterned strokes have a gap colour.

A table with one header row and two body rows in two columns. The counts on the <Table> set the grid; the outer border is set on the table itself.

Stories/Story_ustory.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
  <Story Self="ustory">
    <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
      <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
        <Table Self="utable" HeaderRowCount="1" FooterRowCount="0" BodyRowCount="2" ColumnCount="2"
               AppliedTableStyle="TableStyle/$ID/[Basic Table]"
               TopBorderStrokeColor="Color/Black" TopBorderStrokeWeight="1"
               BottomBorderStrokeColor="Color/Black" BottomBorderStrokeWeight="1"
               LeftBorderStrokeColor="Color/Black" LeftBorderStrokeWeight="1"
               RightBorderStrokeColor="Color/Black" RightBorderStrokeWeight="1">
          <Row Self="urow0" Name="0" SingleRowHeight="24"/>
          <Row Self="urow1" Name="1" SingleRowHeight="24"/>
          <Row Self="urow2" Name="2" SingleRowHeight="24"/>
          <Column Self="ucol0" Name="0" SingleColumnWidth="120"/>
          <Column Self="ucol1" Name="1" SingleColumnWidth="120"/>
          <Cell Self="ucell00" Name="0:0" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]" FillColor="Color/Black"
                BottomEdgeStrokeColor="Color/Black" BottomEdgeStrokeWeight="1"
                RightEdgeStrokeColor="Color/Black" RightEdgeStrokeWeight="1">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>Item</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
          <Cell Self="ucell10" Name="1:0" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]" FillColor="Color/Black"
                BottomEdgeStrokeColor="Color/Black" BottomEdgeStrokeWeight="1">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>Qty</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
          <Cell Self="ucell01" Name="0:1" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]"
                BottomEdgeStrokeColor="Color/Black" BottomEdgeStrokeWeight="1"
                RightEdgeStrokeColor="Color/Black" RightEdgeStrokeWeight="1">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>Paper</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
          <Cell Self="ucell11" Name="1:1" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]"
                BottomEdgeStrokeColor="Color/Black" BottomEdgeStrokeWeight="1">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>12</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
          <Cell Self="ucell02" Name="0:2" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]"
                RightEdgeStrokeColor="Color/Black" RightEdgeStrokeWeight="1">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>Toner</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
          <Cell Self="ucell12" Name="1:2" RowSpan="1" ColumnSpan="1"
                TextTopInset="2" TextLeftInset="3" TextBottomInset="2" TextRightInset="3"
                AppliedCellStyle="CellStyle/$ID/[None]">
            <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
              <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
                <Content>4</Content>
              </CharacterStyleRange>
            </ParagraphStyleRange>
          </Cell>
        </Table>
      </CharacterStyleRange>
    </ParagraphStyleRange>
  </Story>
</idPkg:Story>

The grid

The table has HeaderRowCount + BodyRowCount + FooterRowCount rows and ColumnCount columns, and lists one <Row> per row and one <Column> per column. The counts also assign rows to regions: the first HeaderRowCount rows are the header, the last FooterRowCount the footer, the rest the body. A region decides which cell style a table style gives a cell, and header and footer rows repeat when the table breaks across frames.

Attribute · TableValuesPagedpaged.set
HeaderRowCountintegerread · written
BodyRowCountintegerread · written
FooterRowCountintegerread · written
ColumnCountintegerread · written
AppliedTableStyleTableStyle referenceread · writtenappliedTableStyle
TableDirectionLeftToRightDirectionwritten
SpaceBeforerealnot read
SpaceAfterrealnot read
Selected attributes. All 68 attributes of Table →

TableDirection sets whether column 0 is on the left (LeftToRightDirection) or the right (RightToLeftDirection). SpaceBefore and SpaceAfter add space between the table and the text above and below it.

In Paged: the counts, the rows, columns and cells, and the table style (its region cell styles, border and alternating fills) are applied. TableDirection, SpaceBefore and SpaceAfter are not read yet. Supported · verified

Header rows repeat at the top of each frame a table continues into, and footer rows at the bottom of each frame but the last, so every part of a long table carries its column heads. BreakHeaders and BreakFooters choose how often: in every text column, once per frame or once per page. SkipFirstHeader leaves the header out of the first part and SkipLastFooter the footer out of the last.

In Paged: header and footer rows repeat once per frame. BreakHeaders, BreakFooters, SkipFirstHeader and SkipLastFooter are not read yet. Paged also reads RepeatingHeader and RepeatingFooter set to false to stop the repeat; InDesign does not write these.

Supported · verified

The outer border

The four edges of the table each have their own stroke, set on the <Table> and taking precedence over the table style:

Attributes, per edge (Top…, Bottom…, Left…, Right…)Meaning
…BorderStrokeColorthe stroke's swatch; Swatch/None for no stroke
…BorderStrokeWeightthe weight in points
…BorderStrokeTintthe tint, a percentage
…BorderStrokeTypethe stroke style, such as StrokeStyle/$ID/Solid, StrokeStyle/$ID/ThickThick (a double line) or StrokeStyle/$ID/Dashed
…BorderStrokeGapColor, …BorderStrokeGapTintthe colour between the dashes, dots or lines of a patterned stroke

Row and column dividers

The lines between rows and between columns alternate in two phases. StartRowStrokeCount rows take the start stroke, then EndRowStrokeCount rows the end stroke, and the pattern repeats down the table; columns work the same way across.

AttributesMeaning
StartRowStrokeCount, EndRowStrokeCounthow many dividers each phase covers
StartRowStrokeColor / …Weight / …Tint / …Type / …GapColor, and the EndRow… setthe row-divider strokes of each phase
StartColumnStroke…, EndColumnStroke…the same for column dividers
SkipFirstAlternatingStrokeRows, SkipLastAlternatingStrokeRows (and …Columns)rows or columns left out of the alternation at the start or end

When a table style's dividers apply, InDesign also writes the resulting stroke onto each cell's matching edge, so ordinary grid lines are often carried by the cells. Where a row divider crosses a column divider, the table style's StrokeOrder decides which is on top.

In Paged: the outer border, the row and column dividers and the cell edges are drawn in their stroke style: solid, a double line (ThickThick) as two rules, and the dotted styles as dots. Other named styles, such as Dashed, are drawn solid, and gap colours are read but not painted. Row dividers are drawn over column dividers at crossings; StrokeOrder is not read.

Supported · verified

Frequently asked questions

How does a <Table> define how many rows and columns it has? With HeaderRowCount, BodyRowCount and FooterRowCount, which add up to the number of rows, and ColumnCount. It then lists one <Row> per row and one <Column> per column.

What does a table style give a table? A cell style for each region (header, body, footer, left and right column), the outer border, the dividers and the alternating fills. Anything set on the <Table> itself wins.

Why do grid lines appear when the table's divider attributes are at their defaults? Because InDesign writes the dividers a table style produces onto each cell's edges too, and the cell edge strokes draw the grid.

How is a double or dashed border written? With the edge's stroke type: TopBorderStrokeType="StrokeStyle/$ID/ThickThick" for a double line, StrokeStyle/$ID/Dashed for dashes, and TopBorderStrokeGapColor for the colour between them.

On this page