border-spacing property
8 | ||||
Specifies the space between cells in a table.
This property has no effect if the border-collapse property is set to collapse.
Note: The border-spacing property is supported in Internet Explorer from version 8.
JavaScript page for this property: borderSpacing. You can find other example(s) there. |
Possible values:
One of the following values: | ||||||||||||
|
Description of values:
The horizontal space between cells in length units. For the supported length units, see the length page. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
The vertical space between cells in length units. For the supported length units, see the length page. |
Default: 0.
If only one length value is specified, it affects both the horizontal and vertical spacing. |
Example HTML code 1:
This example illustrates the use of the border-spacing property:
|
||||
<head> <style> .spacing0 { border-spacing: 0px; } .spacing0 td { border: 1px solid blue; } .spacing15 { border-spacing: 15px; } .spacing15 td { border: 1px solid blue; } </style> </head> <body> Table with spacing 0px <table class="spacing0"> <tr> <td>Apple</td> <td>13.46</td> </tr> <tr> <td>Pear</td> <td>35.21</td> </tr> <tr> <td>Peach</td> <td>23.12</td> </tr> </table> <br /><br /> Table with spacing 15px <table class="spacing15"> <tr> <td>Apple</td> <td>13.46</td> </tr> <tr> <td>Pear</td> <td>35.21</td> </tr> <tr> <td>Peach</td> <td>23.12</td> </tr> </table> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
Related pages:
border
border-bottom
border-bottom-color
border-bottom-style
border-bottom-width
border-collapse
border-color
border-left
border-left-color
border-left-style
border-left-width
border-right
border-right-color
border-right-style
border-right-width
border-style
border-top
border-top-color
border-top-style
border-top-width
border-width
border-bottom
border-bottom-color
border-bottom-style
border-bottom-width
border-collapse
border-color
border-left
border-left-color
border-left-style
border-left-width
border-right
border-right-color
border-right-style
border-right-width
border-style
border-top
border-top-color
border-top-style
border-top-width
border-width
External links:
border-spacing (MSDN)
border-spacing (Mozilla Developer Center)
border-spacing (Safari Reference Library)
border-spacing (W3C)
border-spacing (Mozilla Developer Center)
border-spacing (Safari Reference Library)
border-spacing (W3C)
User Contributed Comments