border-collapse
Values:
collapse | separate | inherit
Initial value:
separate
Applies to:
Elements with the display value table or table-inline.
Inherited:
Yes.
Description:
border-collapse lays out the borders in a table.
Examples:
<table id="myEle" border="1" style="border-collapse:collapse">
<tr><td>column 1</td><td>column 2</td><td>column 3</td></tr>
<tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
<tr><td>cell 1</td><td>cell 2</td><td>cell 3</td></tr>
</table>
<button onclick="myEle.style.borderCollapse='separate'">separate</button>
<button onclick="myEle.style.borderCollapse='collapse'">collapse</button>
Home
HTML CSS Book
CSS Reference
HTML CSS Book
CSS Reference
Table:
- border-collapse
- border-spacing
- caption-side
- empty-cells
- table-layout
Related: