HTML and CSS Reference
In-Depth Information
The <table> Element
All the components of a table are placed within a <table>...</table> element:
<table>
...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>
<tr>
<th> Name </th>
<th> Height </th>
<th> Weight </th>
<th> Eye Color </th>
</tr>
<tr>
<td> Alison </td>
<td> 5'4” </td>
<td> 140 </td>
<td> Blue </td>
</tr>
<tr>
<td> Tom </td>
<td> 6'0” </td>
<td> 165 </td>
<td> Hazel </td>
</tr>
<tr>
<td> Susan </td>
<td> 5'1” </td>
<td> 97 </td>
<td> Brown </td>
</tr>
</table>
10
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
this:
< table summary = “vital statistics” >
 
Search WWH ::




Custom Search