snufkin / console-table
A table generator class for the PHP CLI.
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 3
pkg:composer/snufkin/console-table
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-10-18 00:13:36 UTC
README
- Install composer
- Run
composer require snufkin/ConsoleTable
- Profit!
Usage
$table = new \Console\Helper\ConsoleTable(); $table->setHeaders(['Column 1', 'Column 2']); $table->addRow(['data 1', 'data 2']); $table->addRow(['data 3', 'data 4']); $table->addRow(['data 5', 'data 6']); echo $table->getTable();
Customisations
By default all columns are aligned left. To change the alignment
use the 0
as the first parameter in the constructor:
$table = new \Console\Helper\ConsoleTable(0);