##### 33.4.8.2 Taming border, cellspacing, and cellpadding settings

You can specify values for border, cellspacing, and cellpadding in any of these sections:

    [Tables]
    [Attributes]
    [TableAttributes]

However, if you specify values in more than one section for the same attribute (that is, values that apply to the same set of tables) you might get:

Duplicate attribute values

Missing attribute values.

Duplicate attribute values

If you specify table border, cellspacing, or cellpadding values in the [Attributes] section, DITA2Go also includes the Border, Spacing, and Padding settings in the [Tables] section, resulting in duplicate assignments, which are not valid HTML. For these attributes, use only the [Tables] section.

Missing attribute values

If you specify border, cellspacing, or cellpadding values for a table or group of tables in [TableAttributes], even if what you list in [TableAttributes] does not include any corresponding attributes, for that group of tables DITA2Go ignores all of the following:

- the Border, Spacing, and Padding settings (if any) in [Tables]
- any border, cellspacing, or cellpadding values in [Attributes].

This means that if you set any of border, cellspacing, or cellpadding in the [TableAttributes]section, you must set them all; the entry in [TableAttributes] replaces all three. If you set border="0" and you want any cell padding or cell spacing, in the same [TableAttributes] entry you must specify greater-than-zero values for cellspacing and cellpadding. If you omit an attribute, DITA2Go writes no value at all for that attribute, in which case the browser default would apply.

For example, if you specify:

    [Tables]
    Border=0
    Spacing=3
    Padding=6

    [Attributes]
    table= cellspacing="2"

For every table you would get a duplicate assignment for cellspacing:

    <table border="0" cellspacing="3" cellpadding="6" cellspacing="2">

Then if you also specify:

    [TableAttributes]
    FormatA= border="2"

For FormatA tables you would get only a border value:

    <table border="2">

Previous Topic: 33.4.8.1 Specifying default border, cellspacing, and cellpadding values

Next Topic: 33.4.8.3 Excluding border, cellspacing, and cellpadding attributes

Parent Topic: 33.4.8 Adjusting borders, cell spacing, and cell padding

Sibling Topics:

33.4.8.1 Specifying default border, cellspacing, and cellpadding values

33.4.8.3 Excluding border, cellspacing, and cellpadding attributes

Table of Contents • Index