| 3 | use cli_table::{Cell, Style, Table, format::Justify}; |
| 4 | |
| 5 | fn 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 | } |