pub struct Tfoot;Expand description
The <tfoot> element - groups footer rows in a table.
§Purpose
The <tfoot> element groups one or more <tr> elements that contain summary or footer
information for a table. Typically contains totals, summaries, or additional notes.
Like <thead>, it can be repeated when printing multi-page tables and can remain visible
during scrolling.
§Content Categories
- None (only valid within
<table>)
§Permitted Content Model
- Zero or more
<tr>elements
§Common Use Cases
- Displaying totals and summary calculations
- Adding footnotes or additional context
- Showing aggregate data for table columns
- Creating sticky footers for scrollable tables
- Providing supplementary information
§Key Attributes
- Global attributes only
§Example
<!-- Table with totals footer -->
<table>
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget</td>
<td>5</td>
<td>$50</td>
</tr>
<tr>
<td>Gadget</td>
<td>3</td>
<td>$45</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Total</th>
<td>8</td>
<td>$95</td>
</tr>
</tfoot>
</table>
<!-- Footer with notes -->
<table>
<thead>
<tr>
<th>Product</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alpha</td>
<td>Available</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">
<small>* Prices subject to change</small>
</td>
</tr>
</tfoot>
</table>
<!-- Multiple footer rows -->
<table>
<thead>
<tr>
<th>Category</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sales</td>
<td>$100,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Subtotal</th>
<td>$100,000</td>
</tr>
<tr>
<th>Tax (10%)</th>
<td>$10,000</td>
</tr>
<tr>
<th>Total</th>
<td>$110,000</td>
</tr>
</tfoot>
</table>§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Tfoot
impl HtmlElement for Tfoot
impl CanContain<Script> for Tfoot
impl CanContain<Template> for Tfoot
impl CanContain<Tfoot> for Table
impl CanContain<Tr> for Tfoot
Auto Trait Implementations§
impl Freeze for Tfoot
impl RefUnwindSafe for Tfoot
impl Send for Tfoot
impl Sync for Tfoot
impl Unpin for Tfoot
impl UnwindSafe for Tfoot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more