Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Houve alguns erros de script nesta página. Enquanto estes erros são encaminhados para os editores do site, você pode ver o conteúdo parcial abaixo.

Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil) . Junte-se a nós e ajude a fazer o trabalho!

{{ CSSRef }}

Summary

The border-spacing CSS property specifies the distance between the borders of adjacent table cells (only for the separated borders model). This is equivalent to the cellspacing attribute in presentational HTML, but an optional second value can be used to set different horizontal and vertical spacing.

The border-spacing value is also used along the outside edge of the table, where the distance between the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or vertical) border-spacing and the relevant (top, right, bottom, or left) padding on the table.

This property applies only when border-collapse is separate.

{{ cssinfo }}

Syntax

/* border-spacing: length */
border-spacing: 2px;

/* border-spacing: horizontal vertical */
border-spacing: 1% 2em;

border-spacing: inherit;

Values

length
Is a <length> value that describes both the horizontal and vertical spacings between cells. It is used only in the one-value syntax.
horizontal
Is a <length> value that describes the horizontal spacing between cells, that is the space between cells in adjacent columns. It is used only in the two-value syntax.
vertical
Is a <length> value that describes the vertical spacing between cells, that is the space between cells in adjacent rows. It is used only in the two-value syntax.
inherit
Is a keyword indicating that the calculated value of border-spacing of the parent's element must be used.

Formal syntax

{{ csssyntax }}

Examples

View Live Examples

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

Specifications

Specification Status Comment
CSS Level 2 (Revision 1)
The definition of 'border-spacing' in that specification.
Recommendation Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 1.0 (1.7 or earlier) 8.0 4.0 1.0 (85)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? 1.0 (1.9.2) ? ? ?

Etiquetas do documento e colaboradores

 Última atualização por: Sebastianz,