Formatting tables

You can change the appearance of tables by setting properties for the table and table cells or by applying a preset design to the table. See Setting table properties, Setting row and cell properties, and Formatting a table with a preset design.

To format text in tables, you can apply formatting to selected text or use styles. See Formatting text overview.


 
About table tags

When formatting tables in the document window, you can define properties that apply to the entire table or to selected rows, columns, or cells in the table. When a property, such as background color or alignment, is set one way for the whole table and another way for individual table cells, it is useful to understand how the HTML is interpreted.

When the same property is set more than once in a table, it is interpreted in this way: Cell formatting, which is part of the TD tag, takes precedence over table row formatting (TR tag), which in turn takes precedence over table formatting (TABLE tag). Therefore, if you specify a background color of blue for a single cell and then set the background color of the entire table to yellow, the blue cell will not change to yellow, since the TD tag takes precedence over the TABLE tag.

In the following example, the TABLE tag sets a background color of yellow (#FFFF99) for the entire table. The first TR tag changes those cells to green (#33FF66), and the second TD tag changes the top center cell to blue (#333399). The TR and TD tags in the bottom row have not been altered, so those cells take on the table color, which is yellow.

<TABLE BORDER="1" WIDTH="75%" BGCOLOR="#FFFF99">
  <TR BGCOLOR="#33FF66"> 
    <TD>&nbsp;</TD>
    <TD BGCOLOR="#333399">&nbsp;</TD>
    <TD>&nbsp;</TD>
  </TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
  </TR>
</TABLE>