### 24.4.6 Specifying attributes for table cells

To specify attributes for the <td> and <th> elements, you can use any of the following:

Paragraph format

Table format

Attribute marker.

Also see §24.6.5 Specifying row-group, row, and cell attributes with macros.

Paragraph format

If all the cells to which you want to assign a particular attribute or set of attributes contain text in a particular paragraph format, for example CellBody, you can use settings such as the following:

[HtmlStyles]

; CellAttribute inserts the contents of [StyleCellAttribute] into

; the start tag of the enclosing table cell (ignored outside tables).

CellBody = CellAttribute

[StyleCellAttribute]

; doc style = attribute to insert in enclosing table cell start tag,

; used in addition to other cell attributes given under [Table...]

CellBody = class="mycellstyle"

See §26.2.2.2 Assigning WAI attributes to paragraph formats. You can use a macro for the assignment in [StyleCellAttribute].

Table format

To base cell attributes on the table format:

[TableCellAttributes]

FormatA = class="mycellstyle"

See §24.6.5 Specifying row-group, row, and cell attributes with macros. You can use a macro for the assignment in [TableCellAttributes].

Attribute marker

To specify attributes for an individual cell, place a marker of type Cell Attr inside the cell, where Attr is the name of the attribute. The marker content is just the attribute value, without quotes. For example, to assign a CSS class to an individual row, place a marker of type CellClass inside the cell, and make the marker content the name of the class. See §29.2.4 Using attribute markers for HTML or XML.

| 24.4.5 Specifying attributes for table rows |  | 24.4.7 Eliminating automatically generated attributes |