Tables

border-collapse
Values:

collapse | separate | inherit

Initial value:

separate

Applies to:

Elements with the display value table or table-inline.

Inherited:

Yes.

Computed value:

As specified.

Note:

In CSS2, the default value was collapse.

Description:

This property is used to define the layout model used in laying out the borders in a table—i.e., those applied to cells, rows, and so forth. Although the property applies only to tables, it is inherited by all the elements within the table.

Example:
table {border-collapse: separate; border-spacing: 3px 5px;}
Supported by:

Firefox, Opera, Safari.

border-spacing
Values:

<length> <length>? | inherit

Initial value:

0

Applies to:

Elements with the display value table or table-inline.

Inherited:

Yes.

Computed value:

Two absolute lengths.

Note:

Property is ignored unless the border-collapse value is separate.

Description:

This specifies the distance between cell borders in the separated borders model. The first of the two length values is the horizontal separation and the second is the vertical. This property is ignored unless border-collapse is set to separate. Although the property applies only to tables, it is inherited by all of the elements within the table.

Examples:
table {border-collapse: separate; border-spacing: 0;}
table {border-collapse: separate; border-spacing: 3px 5px;}
Supported by:

Firefox, Internet Explorer, Opera, Safari.

caption-side
Values:

top | bottom

Initial value:

top

Applies to:

Elements with the display ...

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.