I was wondering if cell-spacing is actually available in CSS?
I am currently using the following CSS code to display a table and the spacing between each cell seems to be 2px, not 1px as specified in the table attribute. Is there any other way besides forcing each table with the tables html cellspacing attribute, if cell-spacing does not work in CSS?
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2860
I've been thanked 85 times.
Offline
http://www.w3.org/TR/REC-CSS2/propidx.html
look at border and border-collapse
Also look at the box model, and work out how best to apply margins and padding to your <td>s
eg
<table class='mytable'>
<tr><td>...</td>.....
etc etc
table.mytable tr td {
margin:2px 2px 2px 2px;
padding:0
border:#000099 1px solid;
}
the margin is the space applied from the outside of the element to the surrounding elements
the padding is the space applied between the edge of the element to the content inside the element
| Never |


