border spacing

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

CSS border-spacing Property

Example

Set the border-spacing for a table:

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

}

Definition and Usage

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

CSS Syntax

border-spacing: length|initial|inherit;

Property Values

Value Description  
length length Specifies the distance between the borders of adjacent cells in px, cm, etc. Negative values are not allowed
  • If one length value is specified, it specifies both the horizontal and vertical spacing
  • If two length values are specified, the first sets the horizontal spacing and the second sets the vertical spacing