Tables
$
Table
FREEFormatted data tables with headers, auto-sized columns, alternating row colors, alignment, and Unicode borders.
static outputautosizeunicode
# Preview
BOOTING PREVIEW
# Usage
import { Table, fg, colorize } from '@taracod/termui';
const table = new Table({
headers: ['Name', 'Role', 'Status'],
rows: [
['Alice', 'Engineer', colorize('Active', fg.green)],
['Bob', 'Designer', colorize('Away', fg.yellow)],
['Charlie', 'Manager', colorize('Active', fg.green)],
],
alternateRowColor: true,
});
console.log(table.render());# API
| Prop | Type | Default | Description |
|---|---|---|---|
| headers | string[] | [] | Column labels rendered in header row |
| rows | Cell[][] | required | Data rows, including colored strings |
| border | boolean | true | Render Unicode table border |
| alternateRowColor | boolean | false | Apply subtle zebra styling to rows |