Using Tables to Present Content > Formatting tables and cells |
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 column, row, and cell properties, and Using a design scheme to format a table.
To format text in tables, you can apply formatting to selected text or use styles. See Formatting text overview.
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 Dreamweaver interprets the HTML source code.
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 (the tr
tag), which in turn takes precedence over table formatting (the 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> </td> <td bgcolor="#333399"> </td> <td> </td> <tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table>