Browser | Internet Explorer | Netscape | Opera | Safari | Firefox | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Version | 5.5 | 6.0 | 7.0 | 8.0 | 8.0 | 9.0 | 7.0 | 8.0 | 9.2 | 9.5 | 1.3 | 2.0 | 3.1 | 1.5 | 2.0 | 3.0 |
Supported | No | No | No | ? | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
Short information
CSS | CSS2 |
---|---|
Default value | 0 |
Inherited | Yes |
Applied | To tables |
HTML analog | <table cellspacing="..."> |
Reference to specification | http://www.w3.org/TR/CSS21/tables.html#propdef-border-spacing |
Description
With the help of this parameter you can specify any distance between cells borders in a table. But it will not work if you do not determine the parameter border-collapse that has a value collapse.
With the help of this parameter you can specify any distance between cells borders in a table. But it will not work if you do not determine the parameter border-collapse that has a value collapse.
Syntax
border-spacing: value [value]
Arguments
If there is only one value, it determines distance concurrently vertically and horizontally. But if there are two arguments, in that case their duties are divided, so the first determines horizontal distance and the second does vertical one.
If there is only one value, it determines distance concurrently vertically and horizontally. But if there are two arguments, in that case their duties are divided, so the first determines horizontal distance and the second does vertical one.
Example
<!-- table { border: 4px double #333; /* Frame around the table */ border-collapse: separate; /* Way of border imaging */ width: 100%; /* Table width */ border-spacing: 7px 11px; /* Distance between cells */ } td { padding: 5px; /* Areas aruond the text */ border: 1px solid #a52a2a; /* Border around cells */ } --> <table> <tbody> <tr> <td>1</td> <td>2</td> </tr> <tr> <td>3</td> <td>4</td> </tr> </tbody> </table>
The result of this example is shown on the figure 1
Remark
If the parameter "cellspacing" is added to the tag <Table> it will not be taken into account by using the style attribute "border-spacing" and the "cellspacing" value is ignored. The exception of this rule is the browser Internet Explorer which doesn't understand the property "border-spacing"
If the parameter "cellspacing" is added to the tag <Table> it will not be taken into account by using the style attribute "border-spacing" and the "cellspacing" value is ignored. The exception of this rule is the browser Internet Explorer which doesn't understand the property "border-spacing"