Crates.io | lazytable |
lib.rs | lazytable |
version | 0.1.0 |
source | src |
created_at | 2018-01-06 13:46:27.227411 |
updated_at | 2018-01-06 13:46:27.227411 |
description | lazy tables with stupid wrapping |
homepage | |
repository | https://github.com/fiji-flo/lazytable |
max_upload_size | |
id | 45715 |
size | 13,393 |
Add the following dependency to your Cargo manifest…
[dependencies]
lazytable = "0.1"
and look at the docs:
#[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
prettytable is awesome. But wrapping in a teminal is no fun.
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 #
######################