| Crates.io | lil-tabby |
| lib.rs | lil-tabby |
| version | 0.1.2 |
| created_at | 2025-08-23 06:47:53.902877+00 |
| updated_at | 2025-08-23 13:13:48.837291+00 |
| description | A macro-based library for creating visually appealing tables with automatic column spanning |
| homepage | https://github.com/ivs-ug/lil-tabby |
| repository | https://github.com/ivs-ug/lil-tabby |
| max_upload_size | |
| id | 1807272 |
| size | 27,133 |
A lightweight Rust macro for building beautiful terminal tables — with automatic column spanning, header handling, and colorful styling — all powered by tabled.
Perfect for CLI tools, inspectors, and any app that needs clean, readable terminal output.
Vec<Vec<String>>.tabled for advanced tweaks.tabby![] and go.Add to your Cargo.toml:
[dependencies]
lil-tabby = "0.1.2"
use lil_tabby::tabby;
let table = tabby![
{ style: ascii }
["Name", "Type"],
["Some", "Field"],
["Above", "Will", "Span"]
];
println!("{}", table);
Output:
+-------+-------------+
| Name | Type |
+-------+-------------+
| Some | Field |
+-------+------+------+
| Above | Will | Span |
+-------+------+------+
use lil_tabby::tabby;
let table = tabby![
{ style: modern_rounded, header: green, labels: yellow, color: blue, border: red, bold: true }
["Package", "Version"],
["tokio", "1.0"],
["serde", "1.0", "active"]
];
println!("{}", table);
Vec<Vec<String>>use lil_tabby::tabby;
let data: Vec<Vec<String>> = vec![
vec!["Header 1".to_string(), "Header 2".to_string(), "Header 3".to_string()],
vec!["Row 1".to_string()],
vec!["Row 2 Col 1".to_string(), "Row 2 Col 2".to_string()]
];
println!("{}", tabby!(data));
tabled re-export:
use lil_tabby::{tabby, tabled};
let mut table = tabby![
{ style: ascii, border: bright_green }
["a", "b", "c"],
["d", "e"],
["f"]
];
// Align all columns to the right
table.with(tabled::settings::Alignment::right());
println!("{}", table);
Output:
+---+---+---+
| a | b | c |
+---+---+---+
| d | e |
+---+-------+
| f |
+-----------+
The optional { ... } block supports:
| Option | Values | Default | Maps To |
|---|---|---|---|
style |
modern_rounded, ascii, ... |
modern_rounded |
Style::... |
header |
red, green, bright_black, ... |
white |
FG_COLOR |
labels |
same as above | white |
First column |
color |
same as above | white |
Content cells |
border |
same as above | bright_black |
Border lines |
bold |
true / false |
false |
Header bolding |
Color names match
tabled::settings::Color::FG_*(lower-case in macro).
Example:
tabby![
{ style: ascii, header: bright_yellow, color: blue, border: red, bold: true }
["some", "data"]
]
tabled).tabled color names (e.g., bright_green, not lime).tabled is powerful, but awkward for quick CLI tables:
MIT — Do whatever you want. Credit appreciated, not required.