Closed rgoodie closed 7 years ago
Any chance we could put something akin to this as a function?
function table_me($table_data ) { $table = new LucidFrame\Console\ConsoleTable(); $table->addHeader(array_keys($table_data[0])); foreach ($table_data as $row) { $table->addRow(@array_values($row)); } $table->display(); }
That could give an one-liner method to produce a table form an associative array.
You could use setHeaders() to add headers for each column in one-line.
setHeaders()
$table->setHeaders(array_keys($table_data[0]));
Please check the example.
Any chance we could put something akin to this as a function?
That could give an one-liner method to produce a table form an associative array.