ascii-pretty-table
A simple and light weight library for creating ASCII tables.
Uses
Install
npm install ascii-pretty-table
Example
const ascii = require("ascii-pretty-table");
const table = new ascii("A Title");
table.setHeading("Column 1", "Column 2");
table.addRow("Row 1", "Row 2");
table.addRow("Row 3", "Row 4");
console.log(table.toString());
Result
......................
| A Title |
''''''''''''''''''''''
| Column 1 | Column 2|
''''''''''''''''''''''
| Row 1 | Row 2 |
''''''''''''''''''''''
| Row 3 | Row 4 |
''''''''''''''''''''''
You can create table without headings as well.