MCPcopy Create free account
hub / github.com/devashishdxt/cli-table / main

Function main

cli-table/examples/nested.rs:5–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3use cli_table::{Cell, Style, Table, format::Justify};
4
5fn main() -> Result<()> {
6 let nested_table = vec![vec![20.cell()]].table();
7
8 let table = vec![
9 vec!["Tom".cell(), 10.cell().justify(Justify::Right)],
10 vec!["Jerry".cell(), 15.cell().justify(Justify::Right)],
11 vec!["Scooby Doo".cell(), 20.cell().justify(Justify::Right)],
12 vec![
13 "Nested".cell(),
14 nested_table.display()?.cell().justify(Justify::Right),
15 ],
16 ]
17 .table()
18 .title(vec![
19 "Name".cell().bold(true),
20 "Age (in years)".cell().bold(true),
21 ])
22 .bold(true);
23
24 println!("{}", table.display()?);
25
26 Ok(())
27}

Callers

nothing calls this directly

Calls 3

tableMethod · 0.80
boldMethod · 0.45
titleMethod · 0.45

Tested by

no test coverage detected