|
In the first example, we'll assume that you want all the
<TH ...><TD ...><TH ...>deepsea class. (They also apply to any element of the deepseacell class; we'll get to that shortly.)
<STYLE TYPE="text/css">
<!--
.deepsea TH, .deepseacell
{
background-image:url('deepsea.gif');
background-color:blue;
color:white;
font-family:sans-serif;
font-weight:700;
}
-->
</STYLE>
Now we apply the rules to a table by setting the table to the
deepsea class. Notice in the following code that we don't need to do anything special to the <TH ...>deepsea element,
<TABLE CELLPADDING=5 CLASS="deepsea"> <TR> <TH>Operator</TH> <TD>Starflower</TD> <TD>Melody</TD> </TR> <TR> <TH>Ext</TH> <TD>8172</TD> <TD>5673</TD> </TR> <TR> <TH>City</TH> <TD>San Francisco</TD> <TD>San Pedro</TD> </TR> </TABLE>
which gives us this table:
| Operator | Starflower | Melody |
|---|---|---|
| Ext | 8172 | 5673 |
| City | San Francisco | San Pedro |
Now suppose that you can't set the general rule that all
<TH ...>CLASS attribute. We'll set those cells to the
deepseacell class using the same style rules set above. Notice that in this case we don't have a
CLASS attribute in the <TABLE ...>
<TABLE CELLPADDING=5>
<TR>
<TD>turtles</TD>
<TD CLASS="deepseacell">starflowers</TD>
<TD>peaches</TD>
</TR>
<TR>
<TD CLASS="deepseacell">cats</TD>
<TD>patchouli</TD>
<TD>grapefruit</TD>
</TR>
</TABLE>
which gives us
| turtles | starflowers | peaches |
| cats | patchouli | grapefruit |
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.