Tfoot

Struct Tfoot 

Source
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

Source§

const TAG: &'static str = "tfoot"

The HTML tag name (e.g., “div”, “span”, “img”).
Source§

const VOID: bool = false

Whether this is a void element (self-closing, no children allowed).
Source§

impl CanContain<Script> for Tfoot

Source§

impl CanContain<Template> for Tfoot

Source§

impl CanContain<Tfoot> for Table

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.