George and Susan Welcome to our HTML help page!
Home | HTML-Index | Basic HTML | HTML Structure

ADD COLOR



The <BGCOLOR> attribute lets you add color to a table. This can help emphasize important information in the table.

You can add color to a cell <TH> or <TD>, a row <TR>, a column group (<COLGROUR>) or (<COL>), a row group <THEAD>, <TBODY> OR <TFOOT> or an entire table <TABLE>.

When adding color specify the name or hexadecimal value for the color you want to use.

Make sure the color you use does not affect the readability of your table. You may need to change the color of text to make it easier to read.

Type this:
down
<TABLE BORDER=3 BGCOLOR="#99CC00" CELLPADDING=50 ALIGN=CENTER>
<TR>
<TD ALIGN=CENTER>
your text or image</TD>
</TR>
</TABLE>


And you get the following:
down

your text or image





Type this:
down
<TABLE BORDER=2 WIDTH="75%" ALIGN=CENTER>
<COLGROUP SPAN="1"></COLGROUP>
<COLGROUP SPAN="2"></COLGROUP>
<TR BGCOLOR="#000099" VALIGN=TOP>
          <TH ROWSPAN="3" BGCOLOR="#0000FF"><FONT COLOR=WHITE>George's Products</FONT></TH>
          <TH><FONT COLOR=WHITE>Product Name</FONT></TH>
          <TH><FONT COLOR=WHITE>Price per unit</FONT></TH>
          <TH><FONT COLOR=WHITE>Units Available</FONT></TH> </TR>
<TR BGCOLOR="#00CCFF">
          <TD>Art Print</TD>
          <TD>$9.99</TD>
          <TD>40</TD>
</TR>
<TR BGCOLOR="#33CCCC">
          <TD>Books</TD>
          <TD>$3.99</TD>
          <TD>75</TD> </TR>
</TABLE>


And you get the following:
down

George's Products Product Name Price per unit Units Available
Art Print $9.99 40
Books $3.99 75




My home page
Back to Top