border-collapse property
Specifies whether the borders of a table are joined in a single border or not.
This property only works for table elements. If you want to use collapsed borders, the cellSpacing attribute must be set to '0px'.

JavaScript page for this property: borderCollapse. You can find other example(s) there. |
Possible values:

Borders are not drawn between table cell elements. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Default. Separate borders are drawn for all table cell element. |
Default: separate.
Example HTML code 1:
This example illustrates the use of the border-collapse property:
|
||||
<head> <style> .collapsed { border-collapse: collapse; } .collapsed td { border: 1px solid blue; } .separated { border-collapse: separate; } .separated td { border: 1px solid blue; } </style> </head> <body> Table with collapsed border: <table class="collapsed"> <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 separated border: <table class="separated"> <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-color
border-left
border-left-color
border-left-style
border-left-width
border-right
border-right-color
border-right-style
border-right-width
border-spacing
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-color
border-left
border-left-color
border-left-style
border-left-width
border-right
border-right-color
border-right-style
border-right-width
border-spacing
border-style
border-top
border-top-color
border-top-style
border-top-width
border-width
External links:
border-collapse (MSDN)
border-collapse (Mozilla Developer Center)
border-collapse (Safari Reference Library)
border-collapse (W3C)
border-collapse (Mozilla Developer Center)
border-collapse (Safari Reference Library)
border-collapse (W3C)
User Contributed Comments