O'Reilly logo

CSS Pocket Reference, 3rd Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required