Building Tables
- After any caption, colgroup, and thead elements but before any tbody or tr
elements, or - After any caption, colgroup, thead, tbody, and tr elements.
In either of the above cases, only one tfoot element is permitted per table. An example of the tfoot
element placed in code before a tbody element is shown in Listing 7-16.
Listing 7-16. A table demonstrating an alternative placement of the tfoot element
Product | Quantity |
---|---|
Totals | 659 |
Utility Belts | 9 |
Grappling Hooks | 27 |
Smoke Pellets | 623 |
Figure 7-7 shows the output of the code from Listing 7-16. As you can see, the table renders exactly the
same as the code used in Listing 7-15 and shown in Figure 7-6. A tfoot element will always be rendered
at the bottom of the table to which it belongs.
Figure 7-7. Browser output of a table with a table footer row group