Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS border-spacing property

CSS border-spacing property

Example

Set the border spacing of a table:

table

{

border-collapse:

separate

;

border-spacing:

10

px

50

px

;

}

Try it »


Property definition and usage

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

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 a DOCTYPE to be defined in order to support the border-spacing property.


Attribute values

Value Description
length length Specifies the distance between the borders of adjacent cells. Use units such as px and cm. Negative values are not allowed.
  • If one length parameter is defined, it sets both the horizontal and vertical spacing.
  • If two length parameters are defined, 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