Easy Tutorial
❮ Prop Email Type Met Win Close ❯

borderSpacing Property

Style Object

Example

Set the distance between cells in a table:


Definition and Usage

The borderSpacing property sets or returns the distance between cells in a table.

Note: If borderCollapse is 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 this property.


Syntax

Return the borderSpacing property:

Set the borderSpacing property:

Property Values

Value Description
length length Specifies the distance between cells in length units. Negative values are not allowed. The default value is 0. If one length value is specified, it sets both horizontal and vertical spacing. <br> If two length values are specified, the first sets the horizontal spacing and the second sets the vertical spacing.
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Technical Details

Default value: 0
Return value: String, representing the distance between cells in a table.
--- ---
CSS version CSS2
--- ---

More Examples

Example

Return the distance between cells in a table:


Related Articles

CSS Tutorial: CSS Table

CSS Reference: border-spacing Property


Style Object

❮ Prop Email Type Met Win Close ❯