#### 33.4.5 Specifying attributes for table rows

You can specify attributes for the <tr> element with any of the following:

Paragraph format

Table format

Attribute PI marker.

See also:

§33.6.5 Specifying row-group, row, and cell attributes with macros.

Paragraph format

To specify row attributes based on the paragraph format of the content of cells in the row, you can use settings such as the following:

[HTMLParaStyles]
; RowAttribute inserts the contents of [StyleRowAttribute] into the
; start tag of the enclosing table row (ignored outside tables).
CellBody2 = RowAttribute
[StyleRowAttribute]
; doc style = attribute to insert in enclosing table row start tag,
; used in addition to other row attributes given under [Table...]
CellBody2 = bgcolor="yellow"

These settings would assign background color yellow to every row that contains a CellBody2 paragraph, in every table. To apply the settings only to some tables, you can turn these settings on and off around specific tables; see §42.2.9.1 Overriding paragraph and character format properties.

Table format

To base row attributes on the table format:

[TableRowAttributes]
FormatA = bgcolor="yellow"

This setting assigns background color yellow to every row in every FormatA table. See §33.6.5 Specifying row-group, row, and cell attributes with macros.

You can use a macro for the assignment in [TableRowAttributes].

Attribute PI marker

To assign an attribute to an individual row, place a PI marker of type Row 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 class to an individual row, place a PI marker of type RowClass inside any cell in the row. See §38.3 Adding attributes with PI markers.

Previous Topic: 33.4.4 Using PI markers to assign attributes to tables, rows, or cells

Next Topic: 33.4.6 Specifying attributes for table cells

Parent Topic: 33.4 Specifying table attributes

Sibling Topics:

33.4.1 Specifying attributes for all tables

33.4.2 Overriding attributes for selected tables

33.4.3 Assigning a CSS class to a table

33.4.4 Using PI markers to assign attributes to tables, rows, or cells

33.4.6 Specifying attributes for table cells

33.4.7 Eliminating automatically generated attributes

33.4.8 Adjusting borders, cell spacing, and cell padding

33.4.9 Determining the width of table columns

33.4.10 Deciding what to do with empty paragraphs in table cells

Table of Contents • Index