Web4College

CSS border-spacing property

src

Description

CSS border-spacing property represents the space between borders of table cells.

Syntax

border-spacing : +ve length

Property values

+ve lengthDefault

0

length value adds spacing between the borders of table cells. 0px represents both horizontal and vertical spacing.

border-spacing: 0px;
Try it

+ve length

10

one value determines both the horizontal and vertical spacing. There is 10px horizontal and vertical spacing.

border-spacing: 10px;
Try it

H-length V-length (+ve)

20

Two values determine horizontal and vertical spacing of table cells.

The following demo represents 10px horizontal spacing and 20px vertical spacing.

border-spacing: 10px 20px;
Try it

Applicable to

It applies to table element.