/    Sign up×
Reference /Pin to ProfileBookmark

border-spacing

This property defines the length the spacing between neighboring cells in a <table> element. In order for this property to have effect, border-collapse needs to be set to separate.

Syntax

The border-spacing value is a length that defines the space between the cells. If two values are used they each define the horizontal and vertical spacing respectively. This spacing is also applied on the edge of the table between the table’s border and the cells in the first and last rows and the first and last columns. The table’s padding is also applied on top of this spacing.

/* Specifying one length value: */
border-spacing: 4px;

/* Specifying two values, horizontal and vertical spacing: */
border-spacing: 12px 20px;

Values

length
A non-negative length value of any type. Two values can also be used to set both horizontal and vertical spacing respectively.

initial
Global CSS keyword – this sets the property to the default value.

inherit
Global CSS keyword – this sets the property to be inherited from its parent element.

Browser Compatibilty

Demos

Have a code example of border-spacing? Submit a codepen.io demo and we'll showcase it here

to submit a demo.
CSS
×

Success!

Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...