Connecting Tech Pros Worldwide Help | Site Map

CSS - cellpadding and cellspacing

  #1  
Old November 3rd, 2008, 04:05 AM
Seth Watson
Guest
 
Posts: 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 **
  #2  
Old November 3rd, 2008, 07:55 AM
dorayme
Guest
 
Posts: n/a

re: CSS - cellpadding and cellspacing


In article <9c123$490e7848$7695@news.teranews.com>,
"Seth Watson" <what43@yahoo.comwrote:
Quote:
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
  #3  
Old November 3rd, 2008, 09:05 AM
Ben C
Guest
 
Posts: n/a

re: CSS - cellpadding and cellspacing


On 2008-11-03, Seth Watson <what43@yahoo.comwrote:
Quote:
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}
Quote:
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.
  #4  
Old November 3rd, 2008, 09:15 AM
dorayme
Guest
 
Posts: n/a

re: CSS - cellpadding and cellspacing


In article <slrnggtf8i.4m2.spamspam@bowser.marioworld>,
Ben C <spamspam@spam.eggswrote:
Quote:
On 2008-11-03, Seth Watson <what43@yahoo.comwrote:
Quote:
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}
>
Quote:
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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
another attempt at HTML/CSS buttons phil-news-nospam@ipal.net answers 6 May 12th, 2006 01:45 AM
Spacing with CSS and tables in HTML phil-news-nospam@ipal.net answers 0 April 29th, 2006 02:05 AM
New to css, trouble understanding cascading CheGueVerra answers 7 July 21st, 2005 01:50 AM
CSS equivalents for attributes Jeff Thies answers 37 July 21st, 2005 12:12 AM
CSS replacement for table cellspacing? Aaron answers 5 July 20th, 2005 11:51 PM