```rust let mut table = Table::new(); table.maxcolumnwidth = 40;
table.style = TableStyle::extended();
table.addrow(Row::new(vec![ Cell::newwith_alignment("This is some centered text", 2, Alignment::Center) ]));
table.addrow(Row::new(vec![ Cell::new("This is left aligned text", 1), Cell::newwith_alignment("This is right aligned text", 1, Alignment::Right) ]));
table.addrow(Row::new(vec![ Cell::new("This is left aligned text", 1), Cell::newwith_alignment("This is right aligned text", 1, Alignment::Right) ]));
table.add_row(Row::new(vec![ Cell::new("This is some really really really really really really really really really that is going to wrap to the next line", 2), ]));
println!("{}", table.as_string());
```
It is possible to define your own table styles by creating a new instance of TableStyle
This is what the extend table style implementation looks like. This is the defualy style in term-table-rs
rust
pub fn extended() -> TableStyle {
return TableStyle {
top_left_corner: '╔',
top_right_corner: '╗',
bottom_left_corner: '╚',
bottom_right_corner: '╝',
outer_left_vertical: '╠',
outer_right_vertical: '╣',
outer_bottom_horizontal: '╩',
outer_top_horizontal: '╦',
intersection: '╬',
vertical: '║',
horizontal: '═',
};
}
TableStyle
also implements a simple()
table style function and a blank()
table style function
Those styles looks like this