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.