Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS border-collapse property

CSS border-collapse property

Example

Set the collapsing border model for a table:

table

{

border-collapse:

collapse

;

}

Try it »


Property definition and usage

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

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

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the border-collapse property.

Note: No version of Internet Explorer (including IE9) supports the "inherit" value.

Note: The border - collapse property may have unexpected effects if !DOCTYPE is not specified.


Attribute values

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

Related Articles

CSS Tutorial: CSS Table