Table Backgrounds: ColorThe background color of a table can be set using styles. As with any backgrounds, it's important to set the color of the fonts as well as the background. This used to be very difficult, requiring the repeated use of the<FONT ...>
First, let's set the style rules. The following code creates a styles class called
<STYLE TYPE="text/css"> <!-- .tealtable, .tealtable TD, .tealtable TH { background-color:teal; color:white; } --> </STYLE>
Now that we've created the styles we just apply it to a table. We associate the table with the
<TABLE CELLPADDING=5 CLASS="tealtable"> <TR> <TH>Operator</TH> <TH>Ext</TH> <TH>City</TH> </TR> <TR> <TD>Starflower</TD> <TD>8172</TD> <TD>San Francisco</TD> </TR> <TR> <TD>Melody</TD> <TD>5673</TD> <TD>San Pedro</TD> </TR> <TR> <TD>Symphony</TD> <TD>3820</TD> <TD>Montreal</TD> </TR> </TABLE> which gives us this table:
The third line down in the style code deserves a few words of explanation:
.tealtable, .tealtable TD, .tealtable TH
Netscape doesn't interpret styles code quite correctly when thay are applied to tables. To compensate for this problem we set rules for three different types of elements:
any element associated with the |