Skip to main content

Module table

Module table 

Source
Expand description

Table rendering primitives and formatting logic.

The crate root re-exports the main types from this module, so most users will interact with Table, Column, Cell, Trunc, and Align.

The renderer works in three steps:

  1. Measure content width for headers and rows.
  2. Apply column width rules, truncation, and wrapping.
  3. Emit a bordered table using the active terminal width when available.

The public API is intentionally small. Table owns the rows, Column defines the schema, and Cell gives you per-value overrides when needed.

Re-exports§

pub use crate::color::Color;
pub use crate::color::CustomColor;

Modules§

style
Style actions and macros for applying colors and formatting to cells and columns.

Macros§

impl_style_methods
Macro to implement styling methods on a type.

Structs§

Cell
A single table cell with optional styling overrides.
Column
A column definition that bundles the header text with default styling.
ColumnBuilder
Builder returned by Table::column for per-column styling.
SectionBuilder
Builder returned by Table::add_section and Table::add_separator.
SectionStyle
Characters used to overwrite section and separator styles.
Table
Main table type for terminal output.
TableStyle
Characters used to draw table borders and joints.

Enums§

Align
Alignment options for any content supporting alignment.
ColumnTarget
Selector used to apply styling to a column.
ColumnWidth
Width policy for a table column.
Trunc
How to handle content that does not fit inside the available column width.