Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

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

 
 
  Copyright 1997-2002 Idocs inc. Published under the terms of the Open Content License Design by Interspire