HTML for People Who Want to Learn  --  Tables for Starters

Table Border Color

Yes!  You can specify the border color of a table. In some newer versions of browsers, the border color is the same as the page's background color. But you can change the border color and in the process specify the border color for slightly older versions. There are two methods: one supported by Netscape Navigator and Internet Explorer, and the other supported by only Internet Explorer.

 

Netscape Navigator and Internet Explorer

<TABLE BORDER=5 BORDERCOLOR="#FF0000">

Markup Languages
Acronym Full Name
SGML Standard Generalized Markup Language
HTML Hypertext Markup Language

In Navigator, the top and left sides are colored light red, while the bottom and right sides are dark red. In Explorer, all four sides are red, the actual color of "#FF0000". Also in Explorer, each cell has a thin red border.

 

Internet Explorer

<TABLE BORDER=5 BORDERCOLORLIGHT="#FF8080" BORDERCOLORDARK="#A00000">

Markup Languages
Acronym Full Name
SGML Standard Generalized Markup Language
HTML Hypertext Markup Language

In Navigator, the border has the default gray color (or background color) because Navigator does not support these attributes and therefore ignores them. Explorer now displays the border colored pretty similar to how Navigator handles BORDERCOLOR, with the exception of thin borders between each cell.

 

Use Both Methods

<TABLE BORDER=5 BORDERCOLORLIGHT="#FF8080" BORDERCOLORDARK="#A00000" BORDERCOLOR="#FF0000">

Markup Languages
Acronym Full Name
SGML Standard Generalized Markup Language
HTML Hypertext Markup Language

For best results in both browsers, you should use both methods when you want to color the border. Since Navigator doesn't support and will ignore the BORDERCOLORLIGHT and BORDERCOLORDARK attributes, they are placed before BORDERCOLOR.

 

For a list of the 216 browser-safe hexadecimal color codes, click here.

 

     <--- Back to Table Attributes: BORDER

 

Last Modified: Saturday, 18-Jul-98 21:52:36 PDT
Page URL: http://geocities.datacellar.net/SiliconValley/Vista/2823/text/tabcolor.html

1