[thelist] Question: CSS with tables

David Dorward evolt at david.us-lot.org
Wed Sep 24 13:19:56 CDT 2003


On Wed, Sep 24, 2003 at 07:06:07PM +0200, Damien COLA wrote:
>> What is the CSS equivilant of cellpadding="0"?
 
> looks like there's none "usable" at the moment :
> http://tom.me.uk/html-to-css/cellspacing.html

Tom appears to have made a couple of errors in that document (mixing up
cellpadding and cellspacing).

The OP asked about cellpadding.

td, th { padding: 0; }

This _is_ supported by MSIE.

What MSIE doesn't support is border-spacing, which is aprox equiv to the
old cellspacing attribute.

table { border-spacing: 1ex 1em; }

MSIE does, however, support border-collapse:

table { border-collapse: collapse; }

which is equiv to cellspacing="0".

As the OP wanted to set cellpadding to 0, it is possible with CSS, as it
would be if they had intended to say cellspacing.

--
David Dorward


More information about the thelist mailing list