Text Links Ads : Marketing Tips Store : Search Engine Optimization Strategies
WebPosition Gold Pro : Domain Registration Bank : Optilink Software : GoDefy
Mike's Marketing Tools : Mike's Ecommerce Software : Text Links Guide
 
Web HTML-HTML.com
You are here: HTML Codes > Tables > <TR ...>

Attribute for <TR ...>
BGCOLOR =color expression

BGCOLOR sets the background color for a table row. BGCOLOR should only be used if you already know that the background color is compatible with the font color of the page. Otherwise it's easier and more reliable to use styles. See Table Backgrounds: Rows.

For example, this code sets the background color of the first row to a light brown:

this code produces this
<TABLE CELLPADDING=8>
<TR BGCOLOR="#CCCC99">
 <TD>lemons</TD>
 <TD>grapefruit</TD>
 </TR>
<TR>
 <TD>bananas</TD>
 <TD>pineapple</TD>
 </TR>
</TABLE>
lemons grapefruit
bananas pineapple

MSIE and Netscape render row background colors differently if CELLSPACING is set to zero. MSIE fills the entire row with the color, but Netscape leaves spaces between the cells. Unfortunately there's no good workaround for the Netscape problem. Usually the best thing to do is to hide the problem by adding borders to the table:

this code produces this
<TABLE CELLPADDING=8 BORDER=2>
<TR BGCOLOR="#CCCC99">
 <TD>lemons</TD>
 <TD>grapefruit</TD>
 </TR>
<TR>
 <TD>bananas</TD>
 <TD>pineapple</TD>
 </TR>
</TABLE>
lemons grapefruit
bananas pineapple

<TR BACKGROUND="..."> >>>

Copyright © 2002-8 Art Dacor USA LLC. All Rights Reserved.
3727 West Magnolia Blvd #489, Burbank, CA, 91505, USA.
www.HTML-HTML.com