Styling tables

Applying borders to the colgroup element. the first col group has a span of 1 and a green border 2px border. The second colgroup has a span of 1 and no border. The third col group has a span of 1 and no border. The last col group has a span of 2 and a 2px green border. The last two columns should not have a border between them. There should not be a border between the thead, tfoot and the tbody.

A table of browsers and compatibility

This column has border all the way roundthis column has no bordersthis column has no bordersthis column has a border to the left, top and bottomthis column has a border to the right, top and bottom
This column has border all the way roundthis column has no bordersthis column has no bordersthis column has a border to the left, top and bottomthis column has a border to the right, top and bottom
This column has border all the way roundthis column has no bordersthis column has no bordersthis column has a border to the left, top and bottomthis column has a border to the right, top and bottom
This column has border all the way roundthis column has no bordersthis column has no bordersthis column has a border to the left, top and bottomthis column has a border to the right, top and bottom
This column has border all the way roundthis column has no bordersthis column has no bordersthis column has a border to the left, top and bottomthis column has a border to the right, top and bottom

Applying borders to the col element. The third col has a 2px green border. green border. There should not be a border between the thead, tfoot and the tbody.

A table of browsers and compatibility

this column has no bordersthis column has no bordersthis column has no bordersThis column has border all the way roundthis column has no borders
this column has no bordersthis column has no bordersthis column has no bordersThis column has border all the way roundthis column has no borders
this column has no bordersthis column has no bordersthis column has no bordersThis column has border all the way roundthis column has no borders
this column has no bordersthis column has no bordersthis column has no bordersThis column has border all the way roundthis column has no borders
this column has no bordersthis column has no bordersthis column has no bordersThis column has border all the way roundthis column has no borders

Setting the background color of a colgroup element all the columns in ths table should have a grey background. In Safari the last column is incorrectly not grey, this is a bug.

A table of browsers and compatibility

Setting colgroupthebackgroundcolor
grey backgroundgrey backgroundgrey backgroundgrey background
grey backgroundgrey backgroundgrey backgroundgrey background
grey background paddinggrey backgroundgrey backgroundgrey background
grey backgroundgrey backgroundgrey backgroundgrey background

Each row in this table has a 2px green border. The styling is set on the tr element.

A table of browsers and compatibility

Setting borders on trborder is2px solidgreen
Setting borders on trborder is2px solidgreen
Setting borders on trborder is2px solidgreen
Setting borders on trborder is2px solidgreen
Setting borders on trborder is2px solidgreen

The tbody element should have a 2px solid green border. The top row of the table is the thead and has no border. The bottom row is the tfoot and also has no border.

A table of browsers and compatibility

This is thethead andhasno border
this is thetfoot andhasno border
Setting the borderon thetbody elementborder is 2px solid green
Setting the borderon thetbody elementborder is 2px solid green
Setting the borderon thetbody elementborder is 2px solid green

Setting borders on the thead and tfoot. There should be a 2px green border around the top and bottom row of this table

A table of browsers and compatibility

There is a 2px solidgreen borderaround thethead element
there is a 2px solidgreen borderaround thetfoot element
Row headingA table cellA table cellA table cell
Row headingA table cellA table cellA table cell
Row headingA table cellA table cellA table cell

The border hidden property makes borders around the item hidden this border should always be on top. On this table it is applied to the third row in the table. For a full description see table borders in the ccs 2.1 spec.

A table of browsers and compatibility

using the border hidden propertyborder hidden is described in the css2.1 spec section on table borders
Footer cellFooter cellFooter celltable cell
Row headingA table cellA table cell cell
Row headingA table cellA table celltable cell

The border hidden property makes borders around the item hidden this border should always be on top. On this table it is applied to the second column in the table. For a full description see table borders in the ccs 2.1 spec.

A table of browsers and compatibility

Using the border hidden propertyborder hidden is described in the css2.1 spec section on table borders this time on colgroup element
Footer cellThis col has no bordersFooter celltable cell
Row headingThis col has no bordersA table celltable cell
Row headingThis col has no bordersA table celltable cell
Row headingThis col has no bordersA table celltable cell

The border hidden property makes borders around the item hidden this border should always be on top. On this table it is applied to the second cell in the third row in the table. For a full description see table borders in the ccs 2.1 spec.

A table of browsers and compatibility

using the border hidden propertyborder hidden is described in the css2.1 spec section on table borders this time on td element
Footer cellFooter cellFooter celltable cell
Row headingA table cellA table celltable cell
Row headingA table celltable cell
Row headingA table cellA table celltable cell

The visibility: collapse applied to a td element. The description on the behavior is in: 11.2 Visibility: the ‘visibility’ property and 17.5.5 Dynamic row and column effects in the css 2.1 sprec.

When the property is not applied the text Your browser does not apply visibility: collapse is visible

A table of browsers and compatibility

does the browser supportvisibility: collapseon td and th elementsYour browser does not apply visibility: collapse
Footer cellFooter cellFooter cellFooter cell
Row headingYour browser does not apply visibility: collapseA table cellA table cell
Row headingA table cellA table cellA table cell
Row headingA table cellA table cellA table cell

The visibility: collapse applied to a tr element. The description on the behavior is in: 11.2 Visibility: the ‘visibility’ property and 17.5.5 Dynamic row and column effects in the css 2.1 sprec.

When the property is not applied the text Your browser does not apply visibility: collapse is visible

In the case of a tr the rows should close the gap in the table so that it is formatted as though the row was not there.

A table of browsers and compatibility

does the browser supportvisibility: collapseon tr elementsa th
Footer cellFooter cellFooter cellFooter cell
Your browser does not apply visibility: collapse 1Your browser does not apply visibility: collapseYour browser does not apply visibility: collapseYour browser does not apply visibility: collapse
Row heading 2A table cellA table cellA table cell
Row heading 3A table cellA table cellA table cell

The visibility: collapse applied to a colgroup element. The description on the behavior is in: 11.2 Visibility: the ‘visibility’ property and 17.5.5 Dynamic row and column effects in the css 2.1 sprec.

When the property is not applied the text Your browser does not apply visibility: collapse is visible

In the case of a colgroup the rows should close the gap in the table so that it is formatted as though the column was not there.

A table of browsers and compatibility

Heading of a column 1Heading of a column 2Your browser does not apply visibility: collapse 3Heading of a column 4
Footer cellFooter cellYour browser does not apply visibility: collapseFooter cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell

The visibility: collapse applied to a col element. The description on the behavior is in: 11.2 Visibility: the ‘visibility’ property and 17.5.5 Dynamic row and column effects in the css 2.1 sprec.

When the property is not applied the text Your browser does not apply visibility: collapse is visible

In the case of a col the rows should close the gap in the table so that it is formatted as though the column was not there.

A table of browsers and compatibility

Heading of a column 1Heading of a column 2Your browser does not apply visibility: collapse 3Heading of a column 4
Footer cellFooter cellYour browser does not apply visibility: collapseFooter cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell
Row headingA table cellYour browser does not apply visibility: collapseA table cell