#### 33.4.2 Overriding attributes for selected tables

To specify HTML <table> attributes for a single table or a group of tables:

    [TableAttributes]
    ; Table ID = text (macro) to put inside table element, overrides
    ; settings in [Tables] for Border, Spacing, and Padding, and
    ; [Attributes] for table
    SomeTable = attribute="value"

On the left of the = sign you can specify a TableID or a table group name, and you can use wildcards in the name. See §33.2.1 Creating table groups.

On the right of the = sign you can include any arbitrary HTML, even macros (see §37. Working with macros) and JavaScript (perhaps something like onmouseover="javascript:dosomething(now)"). Just keep it all on the same line.

For example, for cell borders, rather than use a global setting for all tables (as you would in the [Tables] section or in the [Attributes] section), you can set the borders based on the table format name:

    [TableAttributes]
    FormatA= border="0" cellspacing="2" cellpadding="1"

Values you specify in the [TableAttributes] section override corresponding settings in the [Tables] section, and also override any attributes you assign to the table element in the [Attributes] section. However, see §33.4.7.2 Taming border, cellspacing, and cellpadding settings for special constraints on specifying values for border, cellspacing, and cellpadding.

See also:

§33.1.1 Understanding precedence of assignment methods

Previous Topic: 33.4.1 Specifying attributes for all tables

Next Topic: 33.4.3 Assigning a CSS class to a table

Parent Topic: 33.4 Specifying table attributes

Sibling Topics:

33.4.1 Specifying attributes for all 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.5 Specifying attributes for table rows

33.4.6 Specifying attributes for table cells

33.4.7 Adjusting borders, cell spacing, and cell padding

33.4.8 Determining the width of table columns

33.4.9 Deciding what to do with empty paragraphs in table cells