View Full Version : equivalent of cellspacing in css

11-30-2002, 07:39 AM
how could i set the cellspacing in css?

11-30-2002, 07:57 AM
td {
margin: 5px;

12-01-2002, 01:43 PM
I get no difference with a margin on TD

AND what about



12-01-2002, 10:08 PM
Try padding:

td {padding:5}

What's all that stuff in there about the border if there isn't any? A demo to show what you've tried? :p

12-03-2002, 06:52 AM
Padding is fine, but I would like to set the cell-spacing using CSS. border-spacing does not work in IE :( thought it worked in Opera

12-03-2002, 07:18 AM
as far as i know, cell spacing would be margins, and cellpadding would be padding. if it's not working, then there's something else going on, and we need to see the rest of the page.

mozilla might let you, and ie 6 might let you, (i don't know if either actually do. hence the might) but technically, i'm not sure it's correct, to be able to assign cellspacing to one cell only. i bring this up, because i note that in the code you've posted, you're using an id. that could be your problem.

i'm sure that jkd or someone else knows for sure, though.

12-03-2002, 09:17 PM
Is there a CSS equivalent for colspan and rowspan? It really eats up the page size and loading times on pages with big tables.

I like foxes...

12-03-2002, 09:29 PM
Hey Tails,

If you're going to use CSS for rowspan/colspan, you may as well go the whole hog and convert to positioned <div> and get rid of those tables!

Anyway, no I don't think so, in answer to your question.


12-03-2002, 09:57 PM
Well, thanks anyway. I use a lot of tables on my site. It's http://XFox_Prower.tripod.com. I made it in notepad and ms-edit. It started out on a dos computer. There is a dos browser that even implements css to some degree.

12-04-2002, 11:49 AM
Be careful of IE's dodgy implementation of the box model (here's a page about that (http://www.tantek.com/CSS/Examples/boxmodelhack.html)). It will give you different results with borders and padding in IE and w3c compliant browsers.

12-04-2002, 09:22 PM
Hmm, I'm not sure what you meant. I did have to play around with the width values though. On my site, the tables should resize properly so the background doesn't overflow and repeat. But a series of cells containing images of fixed width don't add up right sometimes. For example, on a table with no cellspacing or cellpadding, 3 table cells on the same line each containing a 200x40 image should make or work properly in a table of 600 pixel width. Maybe it's the browsers.