Forum Moderators: open

Message Too Old, No Replies

Tables and browsers

Unnecessary attributes

         

malasorte

10:42 am on Oct 6, 2006 (gmt 0)

10+ Year Member



In a table attributes like cellpadding="0" cellspacing="0" border="0" are really necessary? I mean, do browsers automatically assign the value 0 if these attributes are not present?

Thanks!

kaled

10:52 am on Oct 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't remember what all the defaults are, but they are not all zero.

Kaled.

Robin_reala

9:46 pm on Oct 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, because you can control nearly all of them with CSS! border="x" maps directly to table { border: x } and cellpadding="x" maps to th,td { padding: x }. The only slightly tricky one is cellspacing="x". Unfortunately IE doesn't support the CSS equivalent, unless you want cellspacing="0", in which case you can do table { border-collapse: collapse; }.

[edited by: Robin_reala at 9:46 pm (utc) on Oct. 6, 2006]