1. Home
  2. Computing & Technology
  3. Web Design / HTML

Don't Forget the Missing Table Tags
Tags and Attributes That Will Make Your Tables More Accessible

By Jennifer Kyrnin, About.com

The <thead>, <tbody>, and <tfoot> Tags

These three tags can do a lot to make your tables more accessible. They are primarily used as identifiers to define the sections of a table, but with CSS you can also use them to style various parts of a table. They also work well with print versions of an HTML document, as you can do things like define elements in the thead or tfoot to appear at the top and bottom of every page the table prints on.

<thead>

The thead or table header tag defines the rows in a table that should appear at the top of the table. If the table is split across multiple pages (such as in a print-out) the rows in the table head should be displayed at the top of each page. Keep in mind, however that IE 6 does not support repeating the thead across multiple pages of printed tables.

It's a good idea to define your thead elements at the beginning of your table, so that the rendering engine can display them as quickly as possible. In large tables, this can make the page appear to load more quickly.

<table style="width: 400px; border: 1px solid #000; caption-side: bottom;" summary="This table will provide a list of the amount of fur shed by Jennifer's dog Shasta. In this table, the fur is measured by month and displayed in one level of column headings">
<caption align="bottom">Table 1.1: A record of the fur shed annually by Jennifer's dog Shasta</caption>
<thead>
<tr><th>Month</th><th>Fur Shed (mm)</th></tr>
<thead>
<tbody>
<tr><td>January</td><td>13</td></tr>
<tr><td>February</td><td>16</td></tr>
<tr><td>March</td><td>22</td></tr>
<tr><td>April</td><td>20</td></tr>
<tr><td>May</td><td>19</td></tr>
<tr><td>June</td><td>10</td></tr>
<tr><td>July</td><td>6</td></tr>
<tr><td>August</td><td>8</td></tr>
<tr><td>September</td><td>14</td></tr>
<tr><td>October</td><td>18</td></tr>
<tr><td>November</td><td>26</td></tr>
<tr><td>December</td><td>19</td></tr>
</tbody>
</table>

See this example

You can use any standard style properties to style the cells and rows in the table head.

Did you find this article useful or interesting? Post a comment.

Explore Web Design / HTML
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. Tables
  7. Using Caption and Summaries to Make HTML Tables More Accessible>

©2009 About.com, a part of The New York Times Company.

All rights reserved.