tags:

views:

113

answers:

4

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.

+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
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
+3  A: 

Consider using cellspacing and cellpadding attributes for table tag or border-spacing css property.

Kniganapolke
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.
A: 

table { border-spacing: 10px; }

This worked for me once I removed

border-collapse: seperate;

from my table tag.

Kelly