Style borderSpacing property
Example
Set the distance between cells in a table:
document.getElementById("myTable").style.borderSpacing="20px";
Try it »
Definition and Usage
The borderSpacing property sets or returns the distance between cells in a table.
**Note:** If borderCollapse If set to collapse, this property has no effect.
Browser support

All major browsers support the borderSpacing property.
**Note:** IE7 and earlier versions do not support the borderSpacing property. IE8 requires a !DOCTYPE. IE9 supports the property.
Syntax
Return the borderSpacing property:
object
.style.borderSpacing
Set the borderSpacing property:
object
.style.borderSpacing="
length length
|initial|inherit"
Attribute values
| Value | Description |
|---|---|
| length length | Specifies the distance between cells in length units. Negative values are not allowed. The default value is 0.
|
Technical Details
| Default value: | 0 |
|---|---|
| Return Value: | A string representing the distance between cells in a table. |
| CSS version | CSS2 |
More examples
Example
Return the distance between cells in a table:
alert(document.getElementById("myTable").style.borderSpacing);
Try it »
Related Articles
CSS tutorial:CSS Table
CSS Reference Manual:The border-spacing property
The Style object