5.5 thead and tbody Elements
Normally, you’ll put table header cells at the top of a table’s columns, but sometimes you’ll also want to put them at the left of each row. For example, in the Global Temperatures web page in FIGURE 5.7, note the year values in header cells at the left. If you have header cells at the left, very often you’ll want to differentiate those header cells from the ones at the top. The preferred way to differentiate is to put the top cells’ row (or rows) in a thead element and put the subsequent rows in a tbody element. In the Global Temperatures web page, why would you need to differentiate between the header cells at the left and the ones at the top? So you can apply different CSS background-color rules to the different ...
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