The Clico Table class allows for formatting tabular data for the CLI stdOut.
It utilizes the Text class to allow for decorating text for the CLI stdOut.
| package | Default |
|---|
__call(string $method, Array $args) : \Webbtj\Clico\Table
A catch-all used to send Text decoration methods down to table column(s)
string
Array
\Webbtj\Clico\Table__construct(Array $data= null, boolean $firstRowAsHeader= true)
Can optionally populate the data. Can optionally set the first row of data as the header row.
Array
boolean
__toString() : string
stringaddHeader(Array $row) : \Webbtj\Clico\Table
Add a header row. Unsets the previous header row.
Array
\Webbtj\Clico\TableaddRow(\Webbtj\Clico\Row $row) : \Webbtj\Clico\Table
\Webbtj\Clico\Row
\Webbtj\Clico\Tablecell(integer $column, integer $row) : \Webbtj\Clico\Table
integer
integer
\Webbtj\Clico\Tablecolumn(integer $index = null) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\TabledistributeColumns(integer $maxWidth = 160) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\TablegetHeaderLineCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate the header row from the body
\Webbtj\Clico\TextgetHeight() : void
getPipeCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate columns
\Webbtj\Clico\TextgetRowLineCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate body rows
\Webbtj\Clico\TextgetWidth() : integer
integerpopulate(Array $data = null) : \Webbtj\Clico\Table
Reformat Rows' and Columns' widths, heights, and separation characters as necessary. Optionally add rows of data to the table
Array
\Webbtj\Clico\Tablerow(integer $index = null) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\TablesetFirstRowAsHeader() : \Webbtj\Clico\Table
\Webbtj\Clico\TablesetHeaderLineCharacter(String $char, boolean $pushToRows = true) : \Webbtj\Clico\Table
Set the character used to separate the header row from the body
String
boolean
\Webbtj\Clico\TablesetPipeCharacter(String $char, boolean $pushToRows = true) : \Webbtj\Clico\Table
Set the character used to separate columns
String
boolean
\Webbtj\Clico\TablesetRowLineCharacter(String $char, boolean $pushToRows = true) : \Webbtj\Clico\Table
Set the charater used to separate body rows
String
boolean
\Webbtj\Clico\TablepushCharactersToRows() : void
$accessColumn
$accessRow
$headerLineCharacter
'='$pipeCharacter
'|'$rowLineCharacter
'-'$rows
array()