[thelist] Tip: Table cellspacing CSS

James Aylard evolt at pixelwright.com
Wed May 29 13:28:01 CDT 2002


Jonathan,

> table {
> border-collapse: collapse;
> }
[...]
> Anyone know of a better CSS way to get rid of the unsightly white lines
> without resorting to HTML?

    For _eliminating_ border-spacing, that's the right approach. Of course,
"border-collapse: collapse" doesn't allow you to _adjust_ the amount of
border-spacing, but only eliminate it. If you want to be able to adjust it,
you would use:

table {
  border-collapse: separate ;
  border-spacing: 5px ;
}

    Unfortunately, no existing version of IE/Win32 (up to and including IE
6) supports the "border-spacing" property.

> Or a way that works in IE 4?

    Nope, sorry. Of course, neither cellpadding nor cellspacing is
deprecated in x/HTML [1], so they are legal. But your desire to separate
your markup from styling is laudable.

1.
http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_tablemodul
e

James Aylard




More information about the thelist mailing list