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 ...
Get Web Programming with HTML5, CSS, and JavaScript 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.