Proprietà border-collapse CSS

Definition and usage

The border-collapse property sets whether the table borders are merged into a single border or displayed separately as in standard HTML.

See also:

CSS tutorial:Tabella CSS

HTML DOM reference manual:borderCollapse property

Example

Set the merge border model for the table:

table
  {
  border-collapse:collapse;
  }

Try it yourself

CSS syntax

border-collapse: separate|collapse|initial|inherit;

Attribute value

Value Description
separate Default value. Borders will be separated. The border-spacing and empty-cells properties will not be ignored.
collapse If possible, the borders will merge into a single border. The border-spacing and empty-cells properties will be ignored.
inherit Specifies that the border-collapse property should inherit its value from the parent element.

Technical details

Default value: separate
Inheritance: yes
Version: CSS2
JavaScript syntax: object.style.borderCollapse="collapse"

More examples

Merge table borders
This example demonstrates whether the table borders are displayed as a single border or displayed separately as in standard HTML.

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome IE / Edge Firefox Safari Opera
1.0 5.0 1.0 1.2 4.0