Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

border-collapse (CSS property)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Inherited Initial Version
Yes separate CSS2, 2.1

Example

This style rule makes the table element with the ID "results" use the collapsing borders model:

#results {
 border-collapse: collapse;
}

Try it yourself!View all demos

Description

This property specifies the border model that’s to be used for a table or an inline table—that is, an element whose display property has one of the values table or inline-table.

See Table Formatting for details about the table border models.

Value

collapse
selects the collapsing borders model (the border-spacing and empty-cells properties will be ignored)
separate
selects the separated borders model (the border-spacing and empty-cells properties will be taken into account)

Note that the initial value was collapse in CSS2, but it was changed to separate in CSS2.1.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Internet Explorer for Windows versions up to and including 7 don’t support the value inherit.

User-contributed notes

ID:
#1
Date:
Wed, 27 Feb 2008 07:05:53 GMT
Contributed by:
JuhaniC
Status:
This note has not yet been confirmed for accuracy and relevance.

Firefoxes handling of collapse appears to be buggy...

When you collapse borders within a table, the displayed border will come out looking like the margin-top and margin-left were set to 1 less than they should be. While not a big deal it's rather off-putting when it doesn't align flush properly with other elements...

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters