HTML and CSS Reference
Table 14-1. CSS Table Properties
By default, the table and each cell have independent
borders. Borders are merged by setting the value of this
property to collapse .
Controls the spacing between table cells. Horizontal
and vertical spacing can be controlled independently.
Determines whether the table caption is displayed
above or below the table.
If set to hide , turns off the display of borders and
backgrounds associated with empty table cells.
If set to fixed , the width of each column is set in the
column definitions or first row.
Controls the horizontal alignment of content in table
cells. With right-to-left languages, the default is right .
Controls vertical alignment in table cells.
All the properties in Table 14-1 are fully supported by all browsers in widespread use, including IE 8. Earlier
versions of Internet Explorer support them with some minor exceptions.
Styling Table Borders
When you use CSS to add a border to a table, the border affects only the table, and not the cells inside.
You can control each border independently, using the same border properties described in Chapter 9 . The
styles in double_border.html define the table border like this (see Figure 14-6 ):
border: #000 double 10px;
Figure 14-6. With CSS, you can use any border style for a table; the cells are not affected
In fact, you don't need to declare a border or use the same style on every side. The styles in different_
borders.html add a top and bottom border like this (see Figure 14-7 ):
border-top: #000 double 10px;
border-bottom: #999 solid 5px;