lil-tabby 🐱💻
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.
Features
- Auto Column Spanning — Short rows automatically span to fill width.
- First Row as Header — Or data. No extra config needed.
- Rich Styling — Customize style, colors, borders, and bold headers.
- Two Syntaxes — Inline literals or from
Vec<Vec<String>>. - Extensible — Re-exports
tabledfor advanced tweaks. - Zero Boilerplate — Just
tabby![]and go.
Installation
Add to your Cargo.toml:
[]
= "0.1.2"
Usage
Basic Table (Inline)
use tabby;
let table = tabby!;
println!;
Output:
+-------+-------------+
| Name | Type |
+-------+-------------+
| Some | Field |
+-------+------+------+
| Above | Will | Span |
+-------+------+------+
Styled Table with Options
use tabby;
let table = tabby!;
println!;
From Vec<Vec<String>>
use tabby;
let data: = vec!;
println!;
Post-Creation Modification
tabled re-export:
use ;
let mut table = tabby!;
// Align all columns to the right
table.with;
println!;
Output:
+---+---+---+
| a | b | c |
+---+---+---+
| d | e |
+---+-------+
| f |
+-----------+
Styling Options
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!
Limitations
- Max 20 columns (due to const generic limits in
tabled).
→ Anyway, won't fit the screen. Like 640kb, should be enough. - Colors must be mapped to valid
tabledcolor names (e.g.,bright_green, notlime).
Why This Exists
tabled is powerful, but awkward for quick CLI tables:
- No easy header handling
- Manual spanning
- Repetitive styling
License
MIT — Do whatever you want. Credit appreciated, not required.