Using Table of Symfony Console Component one can draw tables with rows and columns.
How to align to the center the content of the columns?
In order to change the style of a Table, one should use the TableStyle class and its setPadType method passing STR_PAD_BOTH
to it.
Example:
$table = new Table($output);
// set table contents
// ...
$tableStyle = new TableStyle();
$tableStyle->setPadType(STR_PAD_BOTH);
$table->setStyle($tableStyle)->render();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With