[−][src]Crate cli_table
A crate for printing tables on command line
Usage
use std::io::Result; use cli_table::{Cell, CellFormat, Justify, Row, Table}; fn main() -> Result<()> { let justify_right = CellFormat::builder().justify(Justify::Right).build(); let bold = CellFormat::builder().bold(true).build(); let table = Table::new(vec![ Row::new(vec![ Cell::new(&format!("Name"), bold), Cell::new("Age (in years)", bold), ]), Row::new(vec![ Cell::new("Tom", Default::default()), Cell::new("10", justify_right), ]), Row::new(vec![ Cell::new("Jerry", Default::default()), Cell::new("15", justify_right), ]), Row::new(vec![ Cell::new("Scooby Doo", Default::default()), Cell::new("25", justify_right), ]), ]); table.print_std() }
Structs
Cell | A |
CellFormat | Struct for configuring a |
CellFormatBuilder | Builder for |
Row | A |
Table | Struct for building a |
Enums
Align | Used to vertically align contents of a |
Color | The set of available colors for the terminal foreground/background. |
Justify | Used to horizontally justify contents of a |