Idocs Guide to HTML

Table Border Colors

In this section we'll look at setting the colors of table borders. First we'll look at setting the borders to a single color. In the next page we'll look at setting the light and dark shades of the border.

The color of the table borders as a whole is set with the BORDERCOLOR attribute of the <TABLE ...> tag. For example, this code sets the border to red:

this code produces this
<TR> <TD>carrots</TD> <TD>garlic</TD> </TR>
<TR> <TD>celery</TD>  <TD>onions</TD> </TR>
carrots garlic
celery onions

Netscape and MSIE have very different ways of rendering BORDERCOLOR. Netscape maintains the 3-D appearance. MSIE renders all borders as the same color, making the border appear flat. MSIE also sets the color of the inner borders.
Browser How The Table Appears
Netscape Netscape's rendering of BORDERCOLOR=RED
In the next page we'll look at how get a little more control over the border colors.

Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.