HTML Dog
Skip to navigation

CSS Property: border-spacing

The spacing between the borders of adjacent table cells

Applies to boxes set to display: table (of which table HTML elements are by default) or display: inline-table.

border-spacing will have no effect if border-collapse is set to collapse.

Possible Values

ValueDescriptionExample
[length]The horizontal and vertical spacing between cells.10px
[length] [length]First length is the horizontal spacing between cells. Second length is the vertical spacing between cells.10px 20px
inherit
initial
unset

Example


table { border-spacing: 10px 20px; }

td { border: 1px solid #ccc; }

Browser support