
| Filename | |
| Version | 0.1.0.2~jammy |
| Age in days | 212 |
| Release date | 2026 04. 07. |
| Size | 5.79 KB |
| id | 4877 |
| Name | php-phplucidframe-console-table |
| Package | |
| Appname | |
| Essential | |
| Vendor | |
| License | |
| Distribution | jammy |
| Suite | main |
| Source | |
| Architecture | binary-arm64 |
| MultiArch | foreign |
| Maintainer | Vítězslav Dvořák |
| InstalledSize | 30 |
| Depends | php-common , php-mbstring |
| PreDepends | |
| Breaks | |
| Enhances | |
| Section | php |
| Priority | optional |
| Description | PHP library to build console style tables |
| LongDescription | ConsoleTable makes you easy to build console style tables. It helps you todisplay tabular data in terminal/shell. It supports bordered and non-borderedtables, custom padding, indentation, and column alignment..This is a component of the PHPLucidFrame framework. |
| AutoBuiltPackage | |
| Filename | pool/main/p/php-phplucidframe-console-table/php-phplucidframe-console-table_0.1.0.2~jammy_all.deb |
| MD5sum | 3b400841fe6e2db60c06014a70c2657d |
| SHA1 | 8a64fd3f6223f4aa17de720ed0c0f214b431fe7a |
| SHA256 | e7045b942bb6705a51bd84cce859092877a6f3f50eb375d736ed5229b9804f62 |
| SHA512 | b8ea5c9d5f5a4328b51b1072d33f4814bf0b51e0859b9caa62d47fa1ee48fb46d7f8f2164099fdbf6cdd1aea434851786ca28d4b5e6591798f6e6bd0eb8bed5a |
| Size | 5930 |
| Auto-Built-Package | |
| Homepage | https://github.com/phplucidframe/console-table |
| Provides | |
| Existing | |
| fileMtime | 2026-04-07 14:33:00 |
| created | 2026-03-22 23:57:44 |
| updated | 2026-04-07 14:33:00 |

ConsoleTabe makes you easy to build console style tables. It helps you to display tabular data in terminal/shell. This is a component of PHPLucidFrame.
License: MIT
composer require phplucidframe/console-table
$table = new LucidFrame\Console\ConsoleTable();
$table
->addHeader('Language')
->addHeader('Year')
->addRow()
->addColumn('PHP')
->addColumn(1994)
->addRow()
->addColumn('C++')
->addColumn(1983)
->addRow()
->addColumn('C')
->addColumn(1970)
->display()
;
You can also print the table using getTable method such as echo $table->getTable();
Output:
+----------+------+
| Language | Year |
+----------+------+
| PHP | 1994 |
| C++ | 1983 |
| C | 1970 |
+----------+------+
You can also use setHeaders() and addRow with Arrays.
$table = new LucidFrame\Console\ConsoleTable();
$table
->setHeaders(array('Language', 'Year'))
->addRow(array('PHP', 1994))
->addRow(array('C++', 1983))
->addRow(array('C', 1970))
->setPadding(2)
->display()
;
Output:
+------------+--------+
| Language | Year |
+------------+--------+
| PHP | 1994 |
| C++ | 1983 |
| C | 1970 |
+------------+--------+
$table = new LucidFrame\Console\ConsoleTable();
$table
->setHeaders(array('Language', 'Year'))
->addRow(array('PHP', 1994))
->addRow(array('C++', 1983))
->addRow(array('C', 1970))
->setIndent(4)
->display()
;
Output:
+----------+------+
| Language | Year |
+----------+------+
| PHP | 1994 |
| C++ | 1983 |
| C | 1970 |
+----------+------+
$table = new LucidFrame\Console\ConsoleTable();
$table
->setHeaders(array('Language', 'Year'))
->addRow(array('PHP', 1994))
->addRow(array('C++', 1983))
->addRow(array('C', 1970))
->hideBorder()
->display()
;
Output:
Language Year
----------------
PHP 1994
C++ 1983
C 1970
$table = new LucidFrame\Console\ConsoleTable();
$table
->addRow(array('PHP', 1994))
->addRow(array('C++', 1983))
->addRow(array('C', 1970))
->hideBorder()
->display()
;
Output:
PHP 1994
C++ 1983
C 1970
$table = new LucidFrame\Console\ConsoleTable();
$table
->setHeaders(array('Language', 'Year'))
->addRow(array('PHP', 1994))
->addRow(array('C++', 1983))
->addRow(array('C', 1970))
->showAllBorders()
->display()
;
Alternatively, you can use addBorderLine() for each row.
$table
->setHeaders(array('Language', 'Year'))
->addRow(array('PHP', 1994))
->addBorderLine()
->addRow(array('C++', 1983))
->addBorderLine()
->addRow(array('C', 1970))
->display()
;
Output
+----------+------+
| Language | Year |
+----------+------+
| PHP | 1994 |
+----------+------+
| C++ | 1983 |
+----------+------+
| C | 1970 |
+----------+------+
$table = new LucidFrame\Console\ConsoleTable();
$table
->addHeader('A')
->addHeader('B', ConsoleTable::ALIGN_RIGHT) # ALIGN_LEFT or ALIGN_RIGHT (ALIGN_LEFT is default)
->addHeader('C')
->addRow()
->addColumn('X')
->addColumn('Hello', null, null, ConsoleTable::ALIGN_RIGHT)
->addColumn('Nice')
->addRow()
->addColumn('Y')
->addColumn('Hello, how are you?')
->addColumn('OK', null, null, ConsoleTable::ALIGN_RIGHT)
->display();
Output
+---+---------------------+------+
| A | B | C |
+---+---------------------+------+
| X | Hello | Nice |
| Y | Hello, how are you? | OK |
+---+---------------------+------+
$table = new LucidFrame\Console\ConsoleTable();
$table
->addHeader('Name')
->addHeader('Age')
->addRow()
->addColumn('John')
->addColumn(25, null, null, ConsoleTable::ALIGN_RIGHT)
->addRow()
->addColumn('Jane')
->addColumn(23, null, null, ConsoleTable::ALIGN_RIGHT)
->addFooter('Total')
->addFooter('48', ConsoleTable::ALIGN_RIGHT)
->display();
Output
+-------+-----+
| Name | Age |
+-------+-----+
| John | 25 |
| Jane | 23 |
+-------+-----+
| Total | 48 |
+-------+-----+
$table = new LucidFrame\Console\ConsoleTable();
$table
->setHeaders(array('Name', 'Age'))
->addRow(array('John', 25))
->addRow(array('Jane', 23))
->setFooters(array('Total', 48))
->hideBorder()
->display();
Output
Name Age
-----------
John 25
Jane 23
-----------
Total 48
With PHPUnit, you can run this in your terminal.
composer install
vendor\bin\phpunit tests
Without PHPUnit, you can simply run this in your terminal.
php example.php
>