Cellspacing -- ARGHHHH

topic posted Sun, April 20, 2008 - 12:03 AM by  furtographer
Share/Save/Bookmark
Advertisement
By the book, the CSS equivalent for table cellpadding and cellspacing is:

td [ padding: 0;]
table [border-spacing: 0;]

But... you guessed it; the border-spacing property isn't supported by IE6 or even IE7.

I'm guessing I have to hard-code all my tables to cellspacing="0" in the HTML.

Any secrets? Javascript or anything that can force the property without resorting to antiquated attributes in the HTML?
posted by:
furtographer
SF Bay Area
Advertisement
Advertisement
  • Well, it seems there's no way to specify a pixel-width for cellspacing in CSS that IE 6 and 7 will honor. But you can turn off cellspacing with the attribute:

    table [border-collapse: collapse;]

    This is helping out a lot. It's cool to colorize table cells, and to border them, but it's not necessary to give specific widths for cellspacing, except to turn it off when there's no room in the layout.
  • Tig
    Tig
    offline 6
    table-less tables?

    Use text boxes to simulate a table with no <table></table>

    An example can be found at covert.puregeek.net

    Click the Valid CSS link at the bottom to get a look at all the styles.

    WARNING: There are links to adult site in one of the "cells". If you click them you will be exposed to porn! </warning>
    • 1) Tables are the one-and-only semantic markup for tabular data.
      2) what's a text-box? You mean a div? There's a wonderful method of forcing divs to display like tables, but... not supported until IE8.
    • not sure what you're looking for

      you could use divs of a set width and height that float, or have them absolutely positioned.
      But if you're looking to use a table, just use a table.

      "use text boxes to simulate a table with no <table></table> "
      do you mean the <span> tag?

Recent topics in "CSS is not a disease!"