Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS border-collapse definition

Syntax

border-collapse: <value>;

Description

This property defines if a border should be collapsed into a single border or detached into several borders. When this is not collapsed there will be some space between the borders.

Values

Value Description
collapse Borders are collapsed into a single border. Default value.
separate Cell borders are separate from table borders.

Example

[Try this example yourself]
<style type="text/css">

.coll table
{
  border-collapse: separate !important;
}

.sep table
{
  border-collapse: collapse !important;
}

</style>

<div class="coll">
  <table border="1">
    <tr>
      <td>First</td>
      <td>Second</td>
    </tr>
    <tr>
      <td>Third</td>
      <td>Fourth</td>
    </tr>
  </table>
</div>

<br />

<div class="sep">
  <table border="1">
    <tr>
      <td>First</td>
      <td>Second</td>
    </tr>
    <tr>
      <td>Third</td>
      <td>Fourth</td>
    </tr>
  </table>
</div>

Output

First Second
Third Fourth

First Second
Third Fourth
  • Comments

No comments added.