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  

Table:
  1. border-collapse
  2. border-spacing
  3. caption-side
  4. empty-cells
  5. table-layout
Related: