1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use prettytable::{cell, ptable, row, table};
use prettytable::{color, Attr};
use prettytable::{Cell, Row, Table};
#[allow(dead_code)]
fn main() {
let _ = table!();
let mut table = Table::new();
table.add_row(row![FrByb->"ABC", "DEFG", "HIJKLMN"]);
table.add_row(row![FY => "styled", "bar", "foo"]);
table.add_row(Row::new(vec![
Cell::new("foobar2"),
Cell::new("bar2").with_style(Attr::ForegroundColor(color::RED)),
Cell::new("foo2").style_spec("FrByb"),
cell!(Fr->"red"),
]));
table.printstd();
ptable!([FrBybl->"A", "B", FrBybr->"C"], [123, 234, 345, 456], [Fg => 1, 2, 3]);
let mut table = table!([Frb => "A", "B", "C"], [1, 2, 3, 4], ["A\nBCCZZZ\nDDD", 2, table]);
table.set_titles(row![c => "Title 1", "Title 2"]);
table.printstd();
}