TabularIntroduction
Introduction
Create beautiful ASCII tables and grids with customizable borders, padding, and alignment for CLI applications.
Last updated:
@visulima/tabular
Create beautiful ASCII tables and grids with full Unicode support, ANSI colors, and flexible configuration options.
Key Features
- ASCII Tables - Create formatted tables with headers and rows
- Unicode Support - Handle CJK characters and emojis correctly
- ANSI Colors - Full support for colored table content
- Flexible Styling - Customizable borders, padding, alignment
- Column Spanning - rowSpan and colSpan support
- Word Wrapping - Automatic content wrapping
- TypeScript - Full type definitions included
Quick Start
import { createTable } from "@visulima/tabular";
const table = createTable();
table.setHeaders(["Name", "Age", "City"]);
table.addRow(["John Doe", "30", "New York"]);
table.addRow(["Jane Smith", "25", "Los Angeles"]);
console.log(table.render());
// ┌───────────┬─────┬─────────────┐
// │ Name │ Age │ City │
// ├───────────┼─────┼─────────────┤
// │ John Doe │ 30 │ New York │
// │ Jane Smith│ 25 │ Los Angeles │
// └───────────┴─────┴─────────────┘