Crate lazytable

Source
Expand description

§lazytable: lazy tables with stuipd wrapping

§Why?

prettytable is awesome. But wrapping in a teminal is no fun.

§Example

    #[macro_use]
extern crate lazytable;
use lazytable::Table;

fn main() {
    let mut table = Table::with_width(23);
    table.set_title(row!["who", "what", "when"]);
    table.add_row(row!["da", "foobar foobar", "bar"]);
    table.add_row(row!["da", "foobar!!", "bar"]);
    print!("{}", table);
}

This will output:

 who | what     | when
-----+----------+------
 da  | foobar   | bar
     | foobar   |
 da  | foobar!! | bar

§What can it do?

For now lazytable only produces a simple table like this (given a terminal width of 20):

Given width of 20:

######################
# da | foobar  | bar #
#    | foobar  |     #
# da | foobar! | bar #
######################

Without a width or with prettytable:

######################
# da | foobar foobar #
#| bar               #
# da | foobar! | bar #
######################

Macros§

row
This macro simplifies Row creation

Structs§

Table
TableConfig
Width, padding and border strings of a table.