CSS border-spacing Property


The border-spacing property sets the distance between the borders of adjacent cells.The border-spacing Property is used to set the distance between the borders of neighboring cells in the Table. This property works only when the border-collapse property is set to no-collapse separate.

Note: This property works only when border-collapse is separate.

CSS Syntax

border-spacing: length|initial|inherit;

Property values:

  • length-length: It is used to set the distance between the borders of adacent cells. It does not allow negative values.
    • If two values are defined, first value defines the horizontal space and second value defines the verical spacing.
    • If only one value is given then it defines the both horizontal and vertical spacing between the adjacent borders of cells.

    Example -