Section 13.3. Row Groups


13.3. Row Groups

HTML and XHTML define three "row group" elements that enable authors to organize rows into a table header (thead), footer (tfoot), and a table body (tbody). Because these elements share syntax and attributes, they have been aggregated into one element listing, presented here.

thead, tbody, tfoot

 <thead>...</thead>, <tbody>...</tbody>, <tfoot>...</tfoot> 

Attributes

Core(id, class, style, title), Internationalization, Events
align="left|center|right|justify|char"
char="character"
charoff="length"
valign="top|middle|bottom|baseline"

Internet Explorer 3.0 first introduced this system for grouping rows so they can be treated as units by user agents or style sheets. The W3C included the row group elements in the HTML 4.0 Recommendation as a way to allow more meaningful labeling, improve accessibility, and provide more flexibility for applying style sheet properties. Row groups are advantageous for data tables but should be avoided for layout tables.

The rows in a table may be grouped into a table head (thead), a table footer (tfoot), and one or more table bodies (tbody). The head and footer should contain information about the document and may someday be used to display fixed elements while the body scrolls independently. Another possibility is that the table head and foot would print on every page of a long table that has been divided over several pages.

The W3C requires that the tfoot element (if there is one) appear before tbody in the markup so the table can render the foot before downloading all the (potentially numerous) rows of data. An example of a simple table marked up with row groups is shown here.

     <table>     <thead>     <tr><th>Employee</th><th>Salary</th><th>Start date</th></tr>     </thead>     <tfoot>     <tr><td colspan="3">Compiled by Buster D. Boss</td></tr>     </tfoot>     <tbody>     <tr><td>Wilma</td><td>5,000</td><td>April 6</td></tr>     <tr>... more data cells...</tr>     <tr>... more data cells...</tr>     </tbody>     </table> 




Web Design in a Nutshell
Web Design in a Nutshell: A Desktop Quick Reference (In a Nutshell (OReilly))
ISBN: 0596009879
EAN: 2147483647
Year: 2006
Pages: 325

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net