Headings and Data
HTML has two elements for table cells: th
and td
.
th
indicates a row or column heading,
whereas td
marks the cell as data
(td
= table data, th
= table heading). In some cases, a cell is
both a heading and data (weâll talk more about that when we get into
complex tables). Letâs start with simple
tables.
Simple tables generally have a one-to-many relationship between each heading and its children cellsâin other words, no heading spans more than one column or row and none of its children are subheadings. The table shown in Figure 6-1 is a simple table because there is only one row of headings (âAttributeâ and âDescriptionâ) and each heading applies to all of the cells in its column.
Figure 6-1. Example of a simple table
Caption
A caption
is a titleâa short
phrase that summarizes the contents of the table.
<table> <caption>Attributes highlighted in Universal Design</caption> <tr> <th>Attribute</th> <th>Description</th> </tr> <tr> <td>summary</td> <td>description of the structure of a table</td> </tr> ... </tr> </table>
Get Universal Design for Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.