console-table-printer icon indicating copy to clipboard operation
console-table-printer copied to clipboard

Table from object with config arguments for all columns

Open jackHedaya opened this issue 4 years ago • 4 comments

Willing to take a crack at this myself, just let me know if this is wanted.

I think it would be useful for the Table constructor or a static from method accepts a object and automatically generates a table. Similar to console.table but also allows a config parameter to change column size and the like.

Let me know!

jackHedaya avatar Nov 14 '21 23:11 jackHedaya

Could also be an addition to #printTable

jackHedaya avatar Nov 15 '21 00:11 jackHedaya

Related, printTable should accept options.

gregorskii avatar Sep 09 '22 14:09 gregorskii

Im thinking about how this will look like in code

printTable (rows, optional Options)

This will have same effect as what we have now

const t = new Table(optional Options);
t.addRows(rows);
r.printTable();

To me its already looking quite short the way a Table instance can be created with predefined options.

ayonious avatar Jul 02 '23 13:07 ayonious

This could be useful feature for CLI tool

ayonious avatar Jul 07 '23 16:07 ayonious