Because browser support for it is a joke? It’s one of the few times I say screw it and still declare cellspacing in my HTML… though it does help with CSS off appearance so no harm no foul. Really funny is the biggest offender in not supporting it historically has been gecko. (much like inline-block or COL)… while 4.x FINALLY fixed this issue (I think… maybe… not sure…) a lot of *nix builds still are on the old engine, so I’m not quite ready to start deploying border-spacing just yet.
I get the feeling that in gecko the table handling code is this mysterious black box ported over from Nyetscape 4.x – given the speed at which issues with tables in browsers like FF get fixed. Right 915?
One ‘issue’ with this workaround – cellspacing also pushes them apart VERTICALLY, so you’d need top or bottom as well… and pushes it in from the edges, which is why I’d be doing:
I don’t see a problem with it in the latest browsers from IE8 upwards. I tried an old gecko version (sea monkey 1.1.17 - which I believe is about FF2 equivalent) and it seemed to work fine there also. I didn’t do extensive testing so there may well be the odd issue in certain circumstances but as far as spacing the borders out in a standard table it seemed to work fine.
However as I still support IE7 I continue to use the cellspacing attribute for ease of use.
Yes, it’s mainly a HTML5/CSS3 solution (although it might work in some older versions of some browsers), because until now there hasn’t really been a neat-ish solution. All I could find were half complete workarounds.
But once I sussed it after an extensive amount of trial and error, I felt I had to share my solution with everyone else who’s probably been tearing their hair out like me and ending up going back to the HTML cellspacing attribute.
It’s just a little give back to all the forums that I’ve used over the years, as a thank you for answering my questions.
Because browser support for it is a joke?
As far as I can recall, and Paul seems to corroborate my oft failing memory, Gecko/Firefox et al were among the first to support this property (I verified for myself that FF3.5 supports border-spacing). IE has been the lone holdout in v.≤7. As to older IEs, I no longer care about making little things work for them, and only worry about the more egregious issues, and then not at all for v.≤6.