Cover by Ben Henick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

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.

Data table anatomy

Figure 10-1. Data table anatomy

Rows and cells: tr and td

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 from tbody, rows and cells are the two elements that must be present in a table.

Readers who are familiar with relational databases will recognize that tr elements signal the bounds of a single record.

Columns and column groups: col and colgroup

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 that n equals the number of cells in each row.

Row and column headings: th

th functions as an alternative to td, and defines the character of data found in a particular row or column.

th elements are distinct from td elements 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required