HTML TABLES INDEX

Table BGColor

The <BGCOLOR=> attribute is used within the <TABLE> <TH><TR> <TD> tags.

Example of BGColor


<TABLE BORDER=1 BGCOLOR="Lime">
<TR>
    <TD></TD>
    <TH BGCOLOR="Aqua">Odd Numbers</TH>
    <TH BGCOLOR="Fuchsia">Even Numbers</TH>
</TR>
<TR>
    <TH ROWSPAN=2>
The<BR>First<BR>Four<BR>Numbers</TH>
    <TD BGCOLOR="Aqua">1</TD>
    <TD BGCOLOR="Fuchsia">2</TD>
</TR>
<TR BGCOLOR="Red">
    <TD>3</TD> 
    <TD>4</TD>
</TR>

</TABLE>

Notes:

  1. Earlier browser versions do not display BGCOLOR consistently, so previewing your page on several browsers is advisable.
  2. By changing the background color of a cell, column or row, important data can be highlighted.
Borders Width & Height