convert cellspacing to CSS

S

shank

What is the equivalent to cellspacing in CSS?
This is not working at all...
border-collapse:collapse; padding:0px; border:0px; border-spacing:0px;

thanks
 
B

beach

shank said:
What is the equivalent to cellspacing in CSS?

Padding, used on the cells.

This is not working at all...
border-collapse:collapse; padding:0px; border:0px; border-spacing:0px;

border-spacing and border-collapse apply *only* to the table element,
as does margin. padding *only* applies to cells (though Mozilla has
some funny ideas about this). Borders can be applied separately to
cells and the table so you can create some nice effects.

Using border-collapse makes border-spacing redundant.
 
B

beach

Padding, used on the cells.

Sorry, I didn't read your post properly.

Cellspacing is done using the border-spacing property on the table selector:

table
{border-spacing:0.5em 1em}


However you've probably been trying to get this to work in MSIE, which
doesn't support it!

You'll have to continue using the attribute or accept that IE users
will have gaps in their tables.

There is a partial workaround for IE6 in that you can use the border-collapse
property on the table selector but this may not always do what you want.
 
S

Steve Pugh

shank said:
What is the equivalent to cellspacing in CSS?
This is not working at all...
border-collapse:collapse; padding:0px; border:0px; border-spacing:0px;

Not working in which browser?

border-spacing is the straight like-for-like replacement for
cellspacing. Note that border-spacing should be set on table, not on
td.

However, IE doesn't support border-spacing. Recent versions of IE
(from 5.5 maybe? need to check) do support border-collapse and
border-collapse: collapse; removes all spacing between cells.

So, table {border-collapse: collapse; border-spacing: 0;} will work in
browser with decent CSS support and recent versions of IE.

Steve
 
S

shank

..coltblshell { width:100%; border-collapse:collapse; border-spacing:0px;
margin-bottom:20px; padding:0px }
The above is not working in IE 6.0.
thanks
 
S

Steve Pugh

shank said:
.coltblshell { width:100%; border-collapse:collapse; border-spacing:0px;
margin-bottom:20px; padding:0px }
The above is not working in IE 6.0.

URL?

Steve
 
M

Michael Wilcox

shank said:
What is the equivalent to cellspacing in CSS?
This is not working at all...
border-collapse:collapse; padding:0px; border:0px; border-spacing:0px;

Adjust the selectors ("table", "td") as they apply in your document:

table
{
border-collapse: collapse;
}

td
{
padding: 0px;
border: 0px;
}
 
S

shank

SHAZAM!!!
thanks!

Michael Wilcox said:
Adjust the selectors ("table", "td") as they apply in your document:

table
{
border-collapse: collapse;
}

td
{
padding: 0px;
border: 0px;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top