View Categories

Table Properties

2 min read

Table properties allow you to write rules that work with tables in your input.

Table properties allow a rule to check if a chunk of content happens to be in a table, and if so where in the table it is. Some properties will be set on the table itself. These properties are not inherited. Other properties will be set on the elements within the table. For example, the column-position property will be set on all elements contained in table cells.

property inherited description
table-title no The table title, if available.
table-header no A multi-valued property containing all of the headers of the table.
column-count no The number of columns in the table.
row-position yes The row number.
column-position yes The column number.
in-table-body yes Set to true for content in the table body.
in-table-header yes Set to true for content in the table header.
column-header yes The column’s header, if available.

Example: Table Properties

first column second column
A B
C D
E F

For the example table above, the following would be true:

  • The property table-header would have two values first column and second column and would only be set on the table element itself.
  • The property row-count is 3 and would only be set on the table element itself.
  • The property column-count is 2 and would only be set on the table element itself.
  • The row-position in cell C would be 2 and would be available on all paragraph and span elements in that cell.
  • The column-position in cell C would be 1 and would be available on all paragraph and span elements in that cell.
  • The in-table-body property would be true for cells A through F and this property would be available on all elements within these cells.
  • The in-header-body property would be true for the header cells containing the text first column and second column, and this would be available on all elements contained within the header cells.
  • The property column-header would be set to first column for cell C and this would be available on all elements contained within that cell.