API Reference
cli-table3
A terminal table renderer with Unicode borders, column alignment, and customizable styles.
Official Documentation ↗CompatibilityThis documentation covers version
v0.6. Check the official docs for the latest API surface.Installation
npm
npm install cli-table3Methods
No methods match this filter.
cli-table3 builds tables from a header and rows and renders them with borders and word wrapping.
Key Features
- Unicode and ASCII border styles
- Column alignment and col widths
- Automatic word wrapping
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
API reference evidence
Fetched from official sources on 2026-11-08T19:26:00+08:00 via WebFetch https://raw.githubusercontent.com/cli-table/cli-table3/master/index.d.ts;WebFetch https://raw.githubusercontent.com/cli-table/cli-table3/master/README.md.
new Table→ signature from https://raw.githubusercontent.com/cli-table/cli-table3/master/index.d.ts; official text: “interface CliTable3 { new (options?: CliTable3.TableConstructorOptions): CliTable3.Table; readonly prototype: CliTable3.Table; }”table.push→ signature from https://raw.githubusercontent.com/cli-table/cli-table3/master/README.md; official text: “// table is an Array, so you canpush,unshift,spliceand friends table.push( [‘First value’, ‘Second value’] , [‘First value’, ‘Second value’] );”table.toString→ signature from https://raw.githubusercontent.com/cli-table/cli-table3/master/README.md; official text: “console.log(table.toString());”
FAQ
- How do I set column widths?
- Pass colWidths as an array; unset entries auto-size. Explicit widths combined with wrapping keep wide content readable.
- Can I use ASCII borders?
- Yes. Pass style: { border: ["+", "-"] } or the compact preset to get ASCII output for terminals without Unicode.
- How do I color cells?
- Apply color functions from a library such as picocolors to cell strings before pushing them, since cli-table3 does not apply colors itself.
Report a problem with this API docOpens a pre-filled issue on GitHub.