CSS Reference Property

border-collapse 6h3n6

The border-collapse property is used to specify the border model of a table. It specifies whether the borders of the table and its table cells should be “ed” or separated. 27e5y

When borders are separate, the table and each of its table cells can have their own distinct borders, and there is space between them. You can control the amount of space between borders of adjacent table cells using the border-spacing property.

When borders are “collapsed”, adjacent table cells share borders, and the cells at the edges of the table share their borders with the borders of the table itself.

bordercollapse
The two tables in the image are identical, except that their border model is specified using the border-collapse property. See the Live Demo section below for a live example.

In the collapsed border model, the border-style property entry for more information.

Official Syntax 55184y

  • Syntax:

    border-collapse: collapse | separate | inherit  
  • Initial: separate
  • Applies To: elements with ‘table’ and ‘inline-table’ display
  • Animatable: no

Values 584j31

separate
Use the separated borders model. The table and its cells all have distinct borders.
collapse
Use the collapsed borders model. The table and table cells’ borders are ed and shared between them.
inherit
Inherits the same border model from its parent.

Examples 3e5p5z

table {
    border-collapse: collapse;
}

table.stats {
    border-collapse: separate;
}
                

Live Demo 2x4j2k

Have a look at the live demo:

View this demo on the Codrops Playground

Browser k5t66

The border-collapse property is ed in all major browsers: Chrome, Firefox, Safari, Opera, Internet Explorer, and on Android and iOS.

Further Reading 4g1p1d

Written by

Last updated June 4, 2020 at 2:30 pm by Mary Lou

Do you have a suggestion, question or want to contribute? Submit an issue.