pub struct Column {Show 13 fields
pub header: Option<Box<dyn Renderable + Send + Sync>>,
pub footer: Option<Box<dyn Renderable + Send + Sync>>,
pub header_style: Style,
pub footer_style: Style,
pub style: Style,
pub justify: JustifyMethod,
pub vertical: VerticalAlignMethod,
pub overflow: OverflowMethod,
pub width: Option<usize>,
pub min_width: Option<usize>,
pub max_width: Option<usize>,
pub ratio: Option<usize>,
pub no_wrap: bool,
/* private fields */
}Expand description
A column definition within a table.
Columns define how data in a particular column should be displayed, including headers, footers, styling, and width constraints.
§Note
The justify, vertical, overflow, and no_wrap fields are defined for API
compatibility but are not yet fully implemented. They will be applied in a future
version. Currently, cell content is rendered with default justification and wrapping.
Fields§
§header: Option<Box<dyn Renderable + Send + Sync>>Column header content.
Column footer content.
header_style: StyleStyle for the header.
Style for the footer.
style: StyleStyle for column cells.
justify: JustifyMethodHorizontal alignment for cell content.
vertical: VerticalAlignMethodVertical alignment for cell content.
overflow: OverflowMethodOverflow handling method.
width: Option<usize>Fixed width (if set, overrides auto-width).
min_width: Option<usize>Minimum width constraint.
max_width: Option<usize>Maximum width constraint.
ratio: Option<usize>Flexible width ratio (for distributing extra space).
no_wrap: boolPrevent text wrapping in this column.
Implementations§
Source§impl Column
impl Column
Sourcepub fn with_header_str(header: &str) -> Self
pub fn with_header_str(header: &str) -> Self
Create a column with a string header.
Sourcepub fn with_header(header: Box<dyn Renderable + Send + Sync>) -> Self
pub fn with_header(header: Box<dyn Renderable + Send + Sync>) -> Self
Create a column with a renderable header.
Sourcepub fn header_style(self, style: Style) -> Self
pub fn header_style(self, style: Style) -> Self
Set the header style.
Set the footer style.
Sourcepub fn justify(self, justify: JustifyMethod) -> Self
pub fn justify(self, justify: JustifyMethod) -> Self
Set the horizontal alignment.
Sourcepub fn vertical(self, vertical: VerticalAlignMethod) -> Self
pub fn vertical(self, vertical: VerticalAlignMethod) -> Self
Set the vertical alignment.
Set the footer content (builder pattern).
Sourcepub fn set_justify(&mut self, justify: JustifyMethod)
pub fn set_justify(&mut self, justify: JustifyMethod)
Set the column justification.
Sourcepub fn set_header_style(&mut self, style: Style)
pub fn set_header_style(&mut self, style: Style)
Set the header style.
Set the footer style.