pretty-table 0.1.3

An easy-to-use crate for printing pretty tables or writing them to a file!
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use pretty_table::prelude::*;

fn main() {
    // define your table as 2-D vectors where all vectors must have `EQUAL` lengths
    let table_data = vec![
        vec!["Name", "Age", "Salary"], // header
        vec!["Altmann", "45", "11.0k"],
        vec!["Bezos", "32", "99.34k"],
        vec!["Pichai", "56", "9.9m"],
        vec!["Cook", "43", "8.2m"],
    ];

    // print to terminal/standard output
    print_table!(table_data.clone());

    // write to file
    write_table_to_file("table.txt", table_data);
}