The equivalent is true for
headers with a rowspan attribute, whereupon the scope value changes to rowgroup. In
such cases, you also need to use the colgroup/rowgroup elements.
These are positioned between the caption and thead of the table (see the following code,
and see the following section for an overview of the various structural elements of tables
combined).
Fruit |
Vegetable |
|---|
Citrus |
Berry |
Root |
Legume |
|---|
TABLES: HOW NATURE (AND THE W3C) INTENDED
241
6
For more complex tables that have intricate structures, using many colspans or rowspans,
where it wouldn??™t be immediately obvious where the relationship lies between a data
cell and a header, you can use id values and the headers element. Each table header cell
should be assigned a unique id value. Each table data cell that refers to one or more headers
requires a headers element. The value of the headers element is the id or ids that the
cell data refers to. Even for simpler data tables, this method can work well??”see the following
code block for how our fruit and vegetables table snippet works with id and
headers.
Fruit |
Vegetable |
|---|
Citrus |
Berry |
Root |
Legume |
|---|
Lemon |
Blueberry |
Potato |
Pea |
Note that the code blocks in this section are here to highlight the attributes and elements
being discussed??”they should not be seen as examples of complete tables.
Pages:
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339