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
string
addHeader(Array $row) : \Webbtj\Clico\Table
Add a header row. Unsets the previous header row.
Array
\Webbtj\Clico\Table
addRow(\Webbtj\Clico\Row $row) : \Webbtj\Clico\Table
\Webbtj\Clico\Row
\Webbtj\Clico\Table
cell(integer $column, integer $row) : \Webbtj\Clico\Table
integer
integer
\Webbtj\Clico\Table
column(integer $index = null
) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\Table
distributeColumns(integer $maxWidth = 160
) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\Table
getHeaderLineCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate the header row from the body
\Webbtj\Clico\Text
getHeight() : void
getPipeCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate columns
\Webbtj\Clico\Text
getRowLineCharacter() : \Webbtj\Clico\Text
Get the character (decorated) used to separate body rows
\Webbtj\Clico\Text
getWidth() : integer
integer
populate(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\Table
row(integer $index = null
) : \Webbtj\Clico\Table
integer
\Webbtj\Clico\Table
setFirstRowAsHeader() : \Webbtj\Clico\Table
\Webbtj\Clico\Table
setHeaderLineCharacter(String $char, boolean $pushToRows = true
) : \Webbtj\Clico\Table
Set the character used to separate the header row from the body
String
boolean
\Webbtj\Clico\Table
setPipeCharacter(String $char, boolean $pushToRows = true
) : \Webbtj\Clico\Table
Set the character used to separate columns
String
boolean
\Webbtj\Clico\Table
setRowLineCharacter(String $char, boolean $pushToRows = true
) : \Webbtj\Clico\Table
Set the charater used to separate body rows
String
boolean
\Webbtj\Clico\Table
pushCharactersToRows() : void
$accessColumn
$accessRow
$headerLineCharacter
'='
$pipeCharacter
'|'
$rowLineCharacter
'-'
$rows
array()