Visit Mozilla.org

CSS:border-spacing

From MDC

« CSS Reference

[edit] Summary

The border-spacing property specifies the distance between the borders of adjacent cells (only for the separated borders model). This is equivalent to the cellspacing attribute in presentational HTML.

[edit] Syntax

border-spacing: <length> | <length> <length> | inherit

[edit] Values

  • <length> : A length to be used for both horizontal and vertical border spacing.
  • <length> <length> : The first length gives the horizontal spacing (space between cells in adjacent columns) and the second length gives the vertical spacing (space between cells in adjacent rows).

[edit] Examples

View Live Examples

table#space {
  border-collapse: separate;
  border-spacing: 10px 5px;
}

[edit] Notes

This property applies only when border-collapse is "separate".

The border-spacing is also used along the outside edge of the table, where the distance between the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or vertical) border-spacing and the relevant (top, right, bottom, or left) padding on the table.

[edit] Specifications

[edit] Browser compatibility

Browser Lowest Version
Netscape 6
Internet Explorer 7
Firefox 1
Mozilla 1
Safari 1
Opera 6


[edit] See also

caption-side table-layout border-collapse border-spacing empty-cells speak-header