CSS: The Definitive Guide

A.2. Tables

A.2.1. border-collapse

This property defines the layout model used in laying out the borders in a tablei.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.

Values:

collapse | separate | inherit

Initial value:

separate

Applies to:

Elements with the display value table or inline-table

Inherited:

Yes

Computed value:

As specified

Note:

In CSS2, the default value was collapse

A.2.2. border-spacing

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 only applies to tables, it is inherited by all of the elements within the table.

Values:

<length> <length>? | inherit

Initial value:

0

Applies to:

Elements with the display value table or inline-table

Inherited:

Yes

Computed value:

Two absolute lengths

Note:

This property is ignored unless border-collapse value is separate

A.2.3. caption-side

This specifies the placement of a table caption with respect to the table box. The caption is rendered as though it were a block-level element placed just before (or after) the table.

Values:

top | bottom

Initial value:

top

Applies to:

Elements with the display value table-caption

Inherited:

Yes

Computed value:

As specified

Note:

The values left and right appeared in CSS2 but were dropped from CSS2.1 due to a lack of widespread support

A.2.4. empty-cells

This defines the presentation of table cells that contain no content. If shown, the cell's borders and background are drawn. This property is ignored unless border-collapse is set to separate.

Values:

show | hide | inherit

Initial value:

show

Applies to:

Elements with the display value table-cell

Inherited:

Yes

Computed value:

As specified

Note:

This property is ignored unless border-collapse value is separate

A.2.5. table-layout

This property specifies which layout algorithm is used to lay out a table. The fixed layout algorithm is faster but less flexible, while the automatic algorithm is slower but more reflective of traditional HTML tables.

Values:

auto | fixed | inherit

Initial value:

auto

Applies to:

Elements with the display value table or inline-table

Inherited:

Yes

Computed value:

As specified

Категории