Applying Background and Foreground Fills

Each table, row, and cell is its own distinct area, and each can have its own background. For example, you might want to apply a different color background to a heading row to make it stand out, or change the color of every other line in a listing to help visitors track a line across the table.

Applying Background and Foreground Fills

To apply a background color to a table, use the same background-color style rule that you use for documents. For example, to make a certain row orange:

<tr style="background-color: orange">

Note

An alternative is the bgcolor argument, which can be applied to any portion of a table or virtually any other element. It is ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.