Introduction to Console_Table

Console_Table helps you to display tabular data on a terminal/shell/console. It provides features similar to those of HTML tables: Header and body (data) parts, alignment of columns, cell padding, multi line cells, border "styles" and column filters.

The class be filled with data by adding rows, adding cols or even importing whole arrays.

When adding whole arrays, e.g. a database result, you might want to format the data of certain columns before displaying them. Attaching a formatting callback to a column using Console_Table::addFilter() helps you with that task.

There might be times when you have an array and just want to get it out to the user, without caring about all the small details. Console_Table::fromArray() is the single-line-of-code tool in such cases.

In combination with PEAR's Console_Color package you can format cells by using e.g. different colors for different cell values - very convenient in combination with column filters.

Console_Table (Previous) Console_Table examples (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.