CSS border-spacingProperty


Example

Set the border spacing of the table:

table { border-collapse:separate; border-spacing:10px 50px; }

Try it Yourself »

Property definition and usage instructions

The border-spacing property sets the distance between the borders of adjacent cells (used only in the "border-separated" mode).

Default Value: not specified
Inherited: no
version: CSS2
JavaScript Syntax: object object.style.borderSpacing="15px"


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the border-spacing property.

NoteIE8 requires defining !DOCTYPE to support the border-spacing property.


Property value

Value Description
length length Specifies the distance between the borders of adjacent cells. Use units such as px, cm. Negative values are not allowed.
  • If one length parameter is defined, then it defines both the horizontal and vertical spacing.
  • If two length parameters are defined, then the first sets the horizontal spacing, and the second sets the vertical spacing.
inherit Specifies that the value of the border-spacing property should be inherited from the parent element.


Related Articles

CSS Tutorial:CSS Table

other extensions