CERTIFICATE IN TELEMATICS (INTERMEDIATE)
Unit 02 Developing web pages
Using Tables - Part 4
Colour in Tables
The Background colour of each cell in the table can be changed. This gives the flexibility to design on different coloured backgrounds, and to add colour and interest to a website without adding image files.
To change the background colour, use the BGCOLOR attribute in either the <TABLE> tag to change the background of the whole table, the <TR> tag to change the background colour of a row or the <TD> or <TH> tag to change the background colour of a single cell.
You can also change the font colour within the table cells to contrast against a coloured background by inserting the STYLE attribute using the COLOR property for the table cell.
e.g. <TD BGCOLOR="#CCFFFF" STYLE="COLOR:#0000CC;">Elephant</TD>
<TABLE BORDER="1" BGCOLOR="#008080">
<TR BGCOLOR="#FFFFFF">
<TH ROWSPAN="4" BGCOLOR="#000080"
STYLE="COLOR:#FFFFFF;">Animal</TD>
<TH>Name</TH>
<TH>Size</TH>
</TR>
<TR>
<TD>Tyrannosaurus Rex</TD>
<TD>Biggest</TD>
</TR>
<TR>
<TD>Elephant</TD>
<TD>Big</TD>
</TR>
<TR>
<TD>Ant</TD>
<TD>Small</TD>
</TR>
</TABLE>
| Animal
| Name |
Size |
| Tyrannosaurus Rex |
Biggest |
| Elephant |
Big |
| Ant |
Small |
Question
Which tag in a table does the bgcolor attribute override all other bgcolors?
© 2003 Ashley Preston
|