Understanding - HTML table borders |
Lotech Solutions (
![]() |
Topic status automatically displays here - do not remove.
This topic explores the ins-and-outs of HTML table colours as defined by the W3C CSS 2 and HTML 4 standards, and demonstrates how a seemingly small difference in table colour style properties or location can make a dramatic difference in the way table colours display within HTML topics.
Note
The basic structure of an HTML table is described in
Understanding HTML Tables.
According to 'CSS2: Section 17.5.1 Table layers and transparency', the different table elements may be thought of as being on six superimposed layers.
The background colour set on an element in one of the layers will only be visible if the layers above it have their background set to transparent.
The table background colour displays through the gap between the table cells as determined by the value of the table cellspacing property. I can't seem to get the cellspacing attribute to work when it's defined as a stylesheet table rule, however, it does when I apply it as an inline table tag property.
Here is the HTML for a simple table consisting of a single-cell in a single-row:
<TABLE> <TR> <TD> Row 1 Cell 1 </TD> </TR> </TABLE>
Here's how that table displays:
Row 1 Cell 1 |
Lotech Solutions' Tips, Tricks, and Procedures
Copyright Lotech Solutions. All rights reserved.