(^324) Chapter 8 Tables
As you reviewed the code sample above, you may have noticed that using the scopeattribute to
provide for accessibility requires less coding than implementing the headersand idattributes.
However, due to inconsistent screen reader support of the scopeattribute, the W3Cās Web
Accessibility Initiative (WAI) WCAG 2.0 recommendations for coding techniques encourage the
use of headersand idattributes rather than the scopeattribute.
XHTML Table Row Groups
There are lots of configuration options when coding tables. Table rows can be put
together into three types of table row groups: table head (<thead>), table body
(<tbody>), and table footer (<tfoot>). This can be useful when you need to configure
the areas in the table in different ways, using either attributes or CSS (see Section 8.3).
The <tbody>tag is required if you configure a <thead>or <tfoot>area, although
you can omit either the table head or table footer if you like. The code sample below
(see student files Chapter8/tables/tablesections.html) configures the table shown in
Figure 8.18 using <thead>and <tbody>groups.
<table border="1" width="75%" summary="This table lists educational
background. Each row describes educational experience at a specific
school. Columns contain school attended, years, subject, and degree
awarded.">
<thead>
<tr>
<th>School Attended</th>
<th>Years</th>
<th>Subject</th>
<th>Degree Awarded</th>
</tr>
</thead>
<tbody>
<tr>
<td>Schaumburg High School</td>
<td>2005 - 2009</td>
<td>College Prep</td>
<td>H.S. Diploma</td>
</tr>
<tr>
<td>Harper College</td>
<td>2009 - 2010</td>
<td>Internet & Web Development</td>
<td>Web Developer Certificate</td>
</tr>
</tbody>
</table>
When you use table row groups, the <thead>and <tfoot>sections must be coded
beforethe <tbody>section to pass W3C XHTML validation. See Chapter8/tables/
tfoot.html for an example.