pub struct Column {
pub name: Option<String>,
pub width: Width,
pub align: Align,
pub anchor: Anchor,
pub overflow: Overflow,
pub null_repr: String,
pub style: Option<String>,
pub style_from_value: bool,
pub key: Option<String>,
pub header: Option<String>,
}Expand description
Configuration for a single column in a table.
Fields§
§name: Option<String>Optional column name/identifier.
width: WidthHow the column determines its width.
align: AlignText alignment within the column.
anchor: AnchorColumn position anchor (left or right edge).
overflow: OverflowHow to handle content that exceeds width.
null_repr: StringRepresentation for null/empty values.
style: Option<String>Optional style name (resolved via theme).
style_from_value: boolWhen true, use the cell value as the style name.
key: Option<String>Optional key for data extraction (supports dot notation for nested fields).
header: Option<String>Optional header title (for table headers and CSV export).
Implementations§
Source§impl Column
impl Column
Sourcepub fn builder() -> ColumnBuilder
pub fn builder() -> ColumnBuilder
Create a column builder for fluent construction.
Sourcepub fn anchor_right(self) -> Self
pub fn anchor_right(self) -> Self
Anchor column to the right edge (shorthand for .anchor(Anchor::Right)).
Sourcepub fn wrap_indent(self, indent: usize) -> Self
pub fn wrap_indent(self, indent: usize) -> Self
Set overflow to wrap with indent.
Sourcepub fn truncate(self, at: TruncateAt) -> Self
pub fn truncate(self, at: TruncateAt) -> Self
Set truncation position (configures Overflow::Truncate).
Sourcepub fn truncate_middle(self) -> Self
pub fn truncate_middle(self) -> Self
Set truncation to middle (shorthand for .truncate(TruncateAt::Middle)).
Sourcepub fn truncate_start(self) -> Self
pub fn truncate_start(self) -> Self
Set truncation to start (shorthand for .truncate(TruncateAt::Start)).
Sourcepub fn ellipsis(self, ellipsis: impl Into<String>) -> Self
pub fn ellipsis(self, ellipsis: impl Into<String>) -> Self
Set the ellipsis/marker for truncation.
Sourcepub fn null_repr(self, null_repr: impl Into<String>) -> Self
pub fn null_repr(self, null_repr: impl Into<String>) -> Self
Set the null/empty value representation.
Sourcepub fn style_from_value(self) -> Self
pub fn style_from_value(self) -> Self
Use the cell value as the style name.
When enabled, the cell content becomes the style tag.
For example, cell value “error” renders as [error]error[/error].