FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

no border for table cell when no data

 


kv
This is the definition of td in my css

Code:

td {
   background: #fff;
   border: solid 1px #ccc;
   color: #000;
}


It works great. But when there is no data in the table cell, it doesn't display the border. I can put an empty space, but I am trying to avoid it since it contributes to the size of the html. Is there anything wrong with css or is this the default behaviour?
adhoc
That's default, yes. This might help.

http://www.w3.org/TR/CSS21/tables.html#empty-cells

Borders and Backgrounds around empty cells: the 'empty-cells' property

The following rule causes borders and backgrounds to be drawn around all cells:

table { empty-cells: show }
kv
It worked. Thanks. BTW, that is a useful site.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.