By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,276 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,276 IT Pros & Developers. It's quick & easy.

CSS - cellpadding and cellspacing

P: n/a
I've seen so many answers on the net I am not sure which one is right or if
there's one answer that will work in all browsers

First off - Table - cellspacing and cellpadding

What is the CSS equivalent for each?
Is this also cross browser compatible?
** Posted from http://www.teranews.com **
Nov 3 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <9c*****************@news.teranews.com>,
"Seth Watson" <wh****@yahoo.comwrote:
I've seen so many answers on the net I am not sure which one is right or if
there's one answer that will work in all browsers

First off - Table - cellspacing and cellpadding

What is the CSS equivalent for each?
Is this also cross browser compatible?
I get by with like:

td {padding: .3em; border: 1px solid black;}
table {border-collapse: collapse;}

--
dorayme
Nov 3 '08 #2

P: n/a
On 2008-11-03, Seth Watson <wh****@yahoo.comwrote:
I've seen so many answers on the net I am not sure which one is right or if
there's one answer that will work in all browsers

First off - Table - cellspacing and cellpadding

What is the CSS equivalent for each?
cellspacing: border-spacing
cellpadding: set padding on the td

e.g.

<table cellspacing=4 cellpadding=5>

works the same as:

table {border-spacing: 4px}
td {padding: 5px}
Is this also cross browser compatible?
It works in all the main browsers, but you'll have to test it in IE to
be sure.
Nov 3 '08 #3

P: n/a
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
On 2008-11-03, Seth Watson <wh****@yahoo.comwrote:
I've seen so many answers on the net I am not sure which one is right or if
there's one answer that will work in all browsers

First off - Table - cellspacing and cellpadding

What is the CSS equivalent for each?

cellspacing: border-spacing
cellpadding: set padding on the td

e.g.

<table cellspacing=4 cellpadding=5>

works the same as:

table {border-spacing: 4px}
td {padding: 5px}
Is this also cross browser compatible?

It works in all the main browsers, but you'll have to test it in IE to
be sure.
border-spacing does not work in IE6. There is nothing much wrong, of
course, with using cellspacing where you need such. There are many
practical solutions to problems that arise where you might want
cellspacing but be hell-bent on pure markup without anything but basic
(default) presentation. But we would need a case or two to play with.

--
dorayme
Nov 3 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.