I am trying to add a table with space between cell as the background colour of the cell is white and the background color of the table is blue, you can easily see that padding and margin are not working (I am applying it to the td
), it will only add space inside of the cell.
views:
113answers:
4
+8
A:
You want border-spacing
:
<table style="border-spacing: 10px;">
Or in a CSS block somewhere:
table {
border-spacing: 10px;
}
See quirksmode on border-spacing
. Be aware that border-spacing
does not work on IE7 and below.
Dominic Rodger
2010-01-15 10:31:42
in IE7 and below, you can use the cellspacing attribute in the table tag. You can supply both to get it working in IE also. Other browsers will prioritize the style.
Tor Valamo
2010-01-15 10:34:33
+3
A:
Consider using cellspacing
and cellpadding
attributes for table
tag or border-spacing
css property.
Kniganapolke
2010-01-15 10:33:50
A:
cellspacing (distance between cells) parameter of the TABLE tag is precisely what you want. The disadvantage is it's one value, used both for x and y, you can't choose different spacing or padding vertically/horizontally. There is a CSS property too, but it's not widely supported.
SF.
2010-01-15 10:38:42
A:
table { border-spacing: 10px; }
This worked for me once I removed
border-collapse: seperate;
from my table tag.
Kelly
2010-10-15 23:09:44