O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

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

Working with Rows and Columns

Using CSS, you can assign different colors and backgrounds to highlight row groups and column groups within your table. This not only makes your table more visually appealing, but it also helps to make your table more readable, by more clearly highlighting its different areas.

Setting Colors and Backgrounds for Row Groups

By assigning colors and backgrounds for the THEAD, TABLE, and TFOOT elements, you can distinguish your table's header, body, and footer sections by formatting them using different color schemes. For instance, here's an example of setting different colors for these three areas of the table (see Figure 12.11:

 table { border-collapse: collapse; border: 1px solid black; border-spacing: 0; width: 90%; ...

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