HTML and CSS Reference
In-Depth Information
The <table> Element
All the components of a table are placed within a <table>...</table> element:
...table caption (optional) and contents...
< /table >
Here's the code that produces the table shown in Figure 10.1. Don't be concerned if you
don't know what this all means right now. For now, notice that the table starts with a
<table> tag and its attributes, and ends with a </table> tag:
<table border=“1”>
<caption> Vital Statistics </caption>
<th> Name </th>
<th> Height </th>
<th> Weight </th>
<th> Eye Color </th>
<td> Alison </td>
<td> 5'4” </td>
<td> 140 </td>
<td> Blue </td>
<td> Tom </td>
<td> 6'0” </td>
<td> 165 </td>
<td> Hazel </td>
<td> Susan </td>
<td> 5'1” </td>
<td> 97 </td>
<td> Brown </td>
The Table Summary
If you want to play by the rules of XHTML, every time you create a table, the <table>
element must include the summary attribute. The value of the summary should be a short
description of the table's contents. Normal visual browsers don't use this value; instead,
it's intended for screen readers and other browsers created for users with disabilities. For
example, the <table> tag in the previous example should include a summary attribute like
< table summary = “vital statistics” >
Search WWH ::

Custom Search