View Full Version : Looking For Help on Cellpadding and Cellspacing
Doug E
09-03-2006, 11:40 AM
Id like to find a good webpage explaining how best to replace the cellpadding and cellspacing elements?. I have been experimenting with amrgin and padding in my styles but trial and error is taking a while for me.
A good site would be much appreciated :)
Arbitrator
09-03-2006, 07:05 PM
I don't have a website for you, but it's really simple: the cellpadding attribute is equivalent to the padding property applied to table cell elements and the cellspacing attribute is equivalent to the border-spacing property as applied to a table. Internet Explorer 7 and prior don't support the border-spacing property however. To accommodate that browser you can still use the border-collapse property on the table which has two effects: it sets border-spacing to zero and collapses borders that would otherwise be doubled (by adjacent bordered table cells) into a single border. Examples:
table {border-spacing: 5px 10px;} /* unsupported in IE */
td {border: 1px dotted red; padding: 5px;}
td {border: 1px dotted blue; padding: 10px;}
table {border-collapse: collapse;}
td {border: 1px dotted brown; padding: 10px;}
Doug E
09-04-2006, 03:13 AM
Ahhh, okay okay, so its border-spacing that I was looking for then. I had found some hacks that werent quite perfect, this is now a similar situation cuz of IE. I guess Ile just default all my table to collapse and work with them from there. Thanks arbitrator, thats very useful for me :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.