Closed Bug 29946 Opened 25 years ago Closed 25 years ago

bgcolor in a td doesnt display when cell is empty/contains a space

Categories

(Core :: Layout: Tables, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED DUPLICATE of bug 8113

People

(Reporter: sentinel, Assigned: rickg)

References

()

Details

In IE5.x the above webpage displays a thing blue border around the text area 
and around the navigation area on the right.

If you view source it's done with commands including:
<td bgcolor="#0000FF" valign=top> </td>
and 
<td bgcolor="#0000FF" valign=top width=1> </td>

In NS4.7 and 2000022716/w98 this border is not displayed. I am assuming it is 
due to the cell being empty because if a character such as a "." is placed 
instead of a space, the border will display, but the TD then takes on the 
current height of the font ...
This is a similar issue to the one raised in bug 8113, "Empty cell's bgcolor not 
rendered", REMIND, but in this case there is a standards-compliant way to
ensure that table cell borders appear even if the cell is empty: the CSS2
empty-cells property. 

See http://www.w3.org/TR/REC-CSS2/tables.html#empty-cells

The CSS2 spec requires that empty cells be transparent by default. Quoting from
bug 8113:
 > ---- Additional Comments From dbaron@fas.harvard.edu  1999-06-14 15:48 ----
 > Watch what you say about W3 specs.  It's actually a requirement of CSS2.
 > In http://www.w3.org/TR/REC-CSS2/tables.html#table-layers , rule 6 says:

 > # The topmost layer contains the cells themselves. As the figure shows, 
 > # although all rows contain the same number of cells, not every cell may 
 > # have specified content. These "empty" cells are transparent, letting lower 
 > # layers shine through.
 > Like it or not, that's the spec.  Since that's what Nav4 implemented, I think
 > it's a bad idea to deviate from it.  If you *want* the background, you can
 > always throw in the &nbsp [or use the empty-cell property].  If things work 
 > the other way around, and you don't want it, it's much harder.

An alternative that does not require css would be to use nested tables with
CELLSPACING on the outer table for as many pixels wide as you want the
border to be, as seen in the code for the page at http://www.mozilla.org/

Marking INVALID as Mozilla is correctly following the spec in not showing
empty cells by default.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Component: HTML Element → HTMLTables
QA Contact: petersen → chrisd
Resolution: --- → INVALID
What did I just do? This bug is actually a DUP of bug 8113!
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Sorry for the spam...

*** This bug has been marked as a duplicate of 8113 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.