### 24.6.6 Capturing table row and column counts with variables

Two predefined macro variables allow you to access the numbers of columns and rows in the current table:

<$$_tblcols> Count of columns in the current table

<$$_tblrows> Count of rows in the current table

You can use these variables in macro expressions that manipulate or make use of table properties. For example, to add a rule above and below each table by placing the rule in an extra row that spans all columns:

[TableStartMacros]

*=<tr><td colspan="<$$_tblcols>"><hr></td></tr>

[TableEndMacros]

*=<tr><td colspan="<$$_tblcols>"><hr></td></tr>

See also:

§24.6.1 Invoking macros around tables

§28.3.4 Using predefined macro variables

| 24.6.5 Specifying row-group, row, and cell attributes with macros |  | 24.6.7 Selectively modifying table text with macros: an example |