Inside JavaScript
The < TBODY > , <TFOOT> , and <THEAD> Elements
Since the early days, tables have become more elaborate, adding header, body, and footer elements, as well as column and row groups. The details of all of HTML are beyond the scope of this book, but here's an example putting these elements to work (note that all the features used here are supported fully only in the Internet Explorer): (Listing 14-10.html on the web site)
<HTML> <HEAD> <TITLE> Tables with bodies, captions, and groups </TITLE> </HEAD> <BODY> <CENTER> <H1>Tables with bodies, captions, and groups</H1> <TABLE BORDER="2" WIDTH="90%" FRAME="HSIDES" RULES="GROUPS"> <CAPTION>Racing Times</CAPTION> <COLGROUP WIDTH="25%"> <COLGROUP ALIGN="CENTER"> <COL SPAN="2" WIDTH="30%"> <COL SPAN="1" WIDTH="15%" </COLGROUP> <THEAD> <TR> <TH>Car</TH> <TH>Race</TH> <TH>Owner</TH> <TH>Time</TH> </TR> </THEAD> <TFOOT> <TR> <TH>Car</TH> <TH>Race</TH> <TH>Owner</TH> <TH>Time</TH> </TR> </TFOOT> <TBODY> <TR> <TD ALIGN="CENTER">69</TD> <TD>Chicago Trials</TD> <TD>Johnson</TD> <TD>5:33</TD> </TR> <TR> <TD ALIGN="CENTER">73</TD> <TD>Chicago Trials</TD> <TD>Chalmo</TD> <TD>6:41</TD> </TR> </TBODY> <TBODY> <TR> <TD ALIGN="CENTER">99</TD> <TD>Lotus Bowl</TD> <TD>Preston</TD> <TD>9:29</TD> </TR> <TR> <TD ALIGN="CENTER">21</TD> <TD>Lotus Bowl</TD> <TD>Liston</TD> <TD>12:23</TD> </TR> </TBODY> </TABLE> </BODY> </HTML> You can see the results in Figure 14.6. Figure 14.6. Using table bodies, captions, and groups.
You can find an overview of the properties and methods of the <TBODY> , <TFOOT> , and <THEAD> elements in Table 14.15, their properties in depth in Table 14.16, and their methods in Table 14.16. JavaScript's core HTML properties, methods, and events, which we covered in Chapters 5 and 6, also apply to the <TBODY> , <TFOOT> , and <THEAD> elements as well. Table 14.15. Overview of the Properties and Methods of the <TBODY> , <TFOOT> , and <THEAD> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to these elements.)
Table 14.16. The Properties of the <TBODY> , <TFOOT> , and <THEAD> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to these elements.)
Table 14.17. The Methods of the <TBODY> , <TFOOT> , and <THEAD> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to these elements.)
|