A Rust library to create ASCII tables with styled borders. Inspired by the PyPi package https://pypi.org/project/tabulate/.
rust
use stybulate::{tabulate, Style, Cell};
let headers = vec!["strings", "numbers"];
let contents = vec![
vec![Cell::Text("answer"), Cell::Int(42)],
vec![Cell::Text("pi"), Cell::Float(3.1415)],
];
let expected = vec![
"╒═══════════╤═══════════╕",
"│ strings │ numbers │",
"╞═══════════╪═══════════╡",
"│ answer │ 42 │",
"├───────────┼───────────┤",
"│ pi │ 3.1415 │",
"╘═══════════╧═══════════╛",
].join("\n");
let table = tabulate(Style::Fancy, contents, headers);
assert_eq!(expected, table);
This project is licensed under either of
at your option.