« Referência CSS
Resumo
The border-spacing property specifies the distance between the borders of adjacent cells (only for the separated borders model). This is equivalent to the cellspacing attribute in presentational HTML.
- Valor inicial: 0
- Aplica-se a: tabelas e tabelas em linha
- Herdado: sim
- Mídia: Visual
- Valor computado: dois comprimentos absolutos
Sintaxe
border-spacing: <length> | <length> <length> | inherit
Valores
- <length> : A length to be used for both horizontal and vertical border spacing.
- <length> <length> : The first length gives the horizontal spacing (space between cells in adjacent columns) and the second length gives the vertical spacing (space between cells in adjacent rows).
Exemplos
View Live Examples
table#space {
border-collapse: separate;
border-spacing: 10px 5px;
}
Notas
This property applies only when border-collapse
is "separate".
The border-spacing 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.
Compatibilidade com navegadores
| Navegador | Versão mais antiga |
| Netscape | 6 |
| Internet Explorer | 7 |
| Firefox | 1 |
| Mozilla | 1 |
| Safari | 1 |
| Opera | 6 |