array2table
is an npm package that takes a 2D array data and converts it into a table format.
You can install the package using npm:
npm install array2table
const array2table = require('array2table');
// Example data
const data = [
['Header1', 'Header2', 'Header3'],
[1, 'Data A', 10],
[2, 'Data B', 20],
// ... add more data as needed
];
const table = array2table(data);
console.log(table);
| Header1 | Header2 | Header3 |
+-----------+-----------+-----------+
| 1 | Data A | 10 |
| 2 | Data B | 20 |