term-data-table 0.2.3

Tables to render data in CLI apps
Documentation

The purpose of term-table is to make it easy for CLI apps to display data in a table format

Example

Here is an example of how to create a simple table

use term_data_table::{ Table, Cell, TableStyle, Alignment, Row };

let table = Table::new()
    .with_style(TableStyle::EXTENDED)
    .with_row(Row::new().with_cell(
        Cell::from("This is some centered text")
            .with_alignment(Alignment::Center)
            .with_col_span(2)
    ))
    .with_row(Row::new().with_cell(
        Cell::from("This is left aligned text")
    ).with_cell(
        Cell::from("This is right aligned text")
            .with_alignment(Alignment::Right)
    ))
    .with_row(Row::new().with_cell(
        Cell::from("This is left aligned text")
    ).with_cell(
        Cell::from("This is right aligned text")
            .with_alignment(Alignment::Right)
    ))
    .with_row(Row::new().with_cell(
        Cell::from("This is some really really really really really really really really really that is going to wrap to the next line")
            .with_col_span(2)
    ));
println!("{}", table.fixed_width(80));

This is the result