The Parts of a Data Table
The best understanding of data table markup begins with an examination of the smaller parts of a table, as illustrated in Figure 10-1.

Figure 10-1. Data table anatomy
- Rows and cells:
trandtd These will typically contain all of the data points that relate to a single item. Rows are themselves divided into cells (
td), and analogous cells in separate rows are always rendered into consistent columns. Apart fromtbody, rows and cells are the two elements that must be present in a table.Readers who are familiar with relational databases will recognize that
trelements signal the bounds of a single record.- Columns and column groups:
colandcolgroup Just as a row relates to a single item, a column relates to a common class of data. Each column in a table corresponds to the table cells found at an interval of
n, given thatnequals the number of cells in each row.- Row and column headings:
th thfunctions as an alternative totd, and defines the character of data found in a particular row or column.thelements are distinct fromtdelements not only in terms of presentation, but also because they are set aside specifically to create table cells that do not contain actual data.- Captions:
caption Headings are assigned to normal copy; in spite of their name,
captions serve an analogous role for data tables. They are always rendered at the top of tables, as a heading would be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access