Changing the Background

Changing the background color of one or more cells is a great way to add visual clarity and structure to your table.

To change a cell’s background color with (X)HTML:

Within the desired tag, type bgcolor= "color", where color is either a name or a hex color (see page 126 and inside back cover).

Figure 16.35. You can add the bgcolor attribute to any part of the table. Here I’ve matched the background of the logo bar to the color of the middle image so that it looks like it stretches with the browser window. And I’ve added a dark green background to the left navigation bar.

To change a cell’s background image or color ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide 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.