pub struct TableConfig {Show 16 fields
pub show_borders: bool,
pub column_widths: Vec<usize>,
pub align_right: Vec<bool>,
pub border_variant: BorderVariant,
pub header_separator_variant: HeaderSeparatorVariant,
pub column_separator: ColumnSeparator,
pub outer_padding: bool,
pub inner_padding: usize,
pub colorize_header: bool,
pub header_color: String,
pub alternating_rows: bool,
pub row_color1: String,
pub row_color2: String,
pub min_column_width: usize,
pub max_column_width: Option<usize>,
pub truncation_marker: String,
}Expand description
Formatter parameters for table output
Defines customizable parameters including borders, separators, padding,
and color options. Use preset methods like bordered() or markdown()
for common configurations, or customize individual parameters.
Fields§
§show_borders: boolShow table borders (deprecated - use border_style)
column_widths: Vec<usize>Column widths (empty = auto-size)
align_right: Vec<bool>Align columns right (false = left align)
border_variant: BorderVariantBorder rendering variant
header_separator_variant: HeaderSeparatorVariantHeader separator line variant
column_separator: ColumnSeparatorColumn separator parameter
outer_padding: boolAdd padding at outer edges of table
inner_padding: usizeNumber of padding spaces within cells
colorize_header: boolEnable ANSI coloring for header row
header_color: StringANSI color code for header (default: none)
alternating_rows: boolEnable alternating row colors
row_color1: StringFirst row color
row_color2: StringSecond row color (for alternating)
min_column_width: usizeMinimum width for each column
max_column_width: Option<usize>Maximum width for columns (None = unlimited)
truncation_marker: StringMarker string for truncated content
Implementations§
Source§impl TableConfig
impl TableConfig
Sourcepub fn show_borders(self, show: bool) -> Self
👎Deprecated: Use border_variant() instead
pub fn show_borders(self, show: bool) -> Self
Set whether to show table borders
Sourcepub fn column_widths(self, widths: Vec<usize>) -> Self
pub fn column_widths(self, widths: Vec<usize>) -> Self
Set column widths (empty = auto-size)
Sourcepub fn align_right(self, align: Vec<bool>) -> Self
pub fn align_right(self, align: Vec<bool>) -> Self
Set column alignment (true = right, false = left)
Sourcepub fn plain() -> Self
pub fn plain() -> Self
Plain variant: space-separated with dash separator (default) Ideal for CLI tools output (ps, top, pmon, etc.)
Sourcepub fn minimal() -> Self
pub fn minimal() -> Self
Minimal variant: space-separated, no separator Maximum simplicity and information density
Sourcepub fn bordered() -> Self
pub fn bordered() -> Self
Bordered variant: traditional pipe-separated table PostgreSQL-style output
Sourcepub fn markdown() -> Self
pub fn markdown() -> Self
Markdown variant: GitHub-flavored Markdown table Ready for documentation and README files
Sourcepub fn grid() -> Self
pub fn grid() -> Self
Grid variant: full ASCII box with intersections Maximum visual clarity for formal reports
Sourcepub fn unicode_box() -> Self
pub fn unicode_box() -> Self
Unicode box variant: Unicode box-drawing characters Modern, professional appearance for terminal UIs
Sourcepub fn csv() -> Self
pub fn csv() -> Self
CSV variant: comma-separated values Standard format for data export and Excel import
Sourcepub fn compact() -> Self
pub fn compact() -> Self
Compact variant: single-space separator, minimal padding Maximum information density for narrow terminals
Sourcepub fn border_variant(self, variant: BorderVariant) -> Self
pub fn border_variant(self, variant: BorderVariant) -> Self
Set border rendering variant
Sourcepub fn header_separator_variant(self, variant: HeaderSeparatorVariant) -> Self
pub fn header_separator_variant(self, variant: HeaderSeparatorVariant) -> Self
Set header separator line variant
Sourcepub fn column_separator(self, sep: ColumnSeparator) -> Self
pub fn column_separator(self, sep: ColumnSeparator) -> Self
Set column separator parameter
Sourcepub fn outer_padding(self, enabled: bool) -> Self
pub fn outer_padding(self, enabled: bool) -> Self
Enable/disable padding at outer table edges
Sourcepub fn inner_padding(self, spaces: usize) -> Self
pub fn inner_padding(self, spaces: usize) -> Self
Set number of padding spaces within cells
Sourcepub fn colorize_header(self, enabled: bool) -> Self
pub fn colorize_header(self, enabled: bool) -> Self
Enable/disable header row coloring
Sourcepub fn header_color(self, color: String) -> Self
pub fn header_color(self, color: String) -> Self
Set ANSI color code for header row
Sourcepub fn alternating_rows(self, enabled: bool) -> Self
pub fn alternating_rows(self, enabled: bool) -> Self
Enable/disable alternating row colors
Sourcepub fn row_colors(self, color1: String, color2: String) -> Self
pub fn row_colors(self, color1: String, color2: String) -> Self
Set colors for alternating rows
Sourcepub fn min_column_width(self, width: usize) -> Self
pub fn min_column_width(self, width: usize) -> Self
Set minimum column width
Sourcepub fn max_column_width(self, width: Option<usize>) -> Self
pub fn max_column_width(self, width: Option<usize>) -> Self
Set maximum column width (None for unlimited)
Sourcepub fn truncation_marker(self, marker: String) -> Self
pub fn truncation_marker(self, marker: String) -> Self
Set truncation marker string
Trait Implementations§
Source§impl Clone for TableConfig
impl Clone for TableConfig
Source§fn clone(&self) -> TableConfig
fn clone(&self) -> TableConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more