tags:

views:

52

answers:

1

I was looking for some resources about the use of CSS instead of tables and reached this presentation by Douglas Bowman that seems to be a 'classic'. I dug into it and found this sentence about the tables in the slide 6 that is very intriguing:

Keep the cellspacing attribute in the markup.

It's curious that in Eric Meyer's reset CSS is:

/* tables still need 'cellspacing="0"' in the markup */
table {
    border-collapse: separate;
    border-spacing: 0;
}

These makes me think having cellspacing in the mark up is really a best practice I didn't know. In my opinion the cellspacing is more about the presentation than about the semantics of the info. I've been thinking for a while but haven't been able to figure out why should I keep it in the HTML?

+3  A: 

You can set border-collapse: collapse on all browsers. But other values for border-collapse and the border-spacing property are not supported before IE8.

Personally, I've never found a reason to use anything other than border-collapse: collapse - separated borders on tables usually look pretty awful.

DisgruntledGoat
+1: the way to go. Just get rid of `cellspacing=0` and use `table { border-collapse: collapse; }` instead.
BalusC
Yes I'm aware of border-collapse. I'm just wondering why would somebody use cellspacing markup attribute
victor hugo
Well I guess what he means is that if you *want* cellspacing, the only reliable way to do it (back then, anyway) is to use the attribute, not CSS.
DisgruntledGoat