Table
class Table
Provides helpers to display a table.
Methods
Gets a style definition by name.
Gets the current table style.
Gets the current style for a column.
No description
No description
No description
No description
No description
Renders table to output.
Details
at line line 72
__construct(OutputInterface $output)
at line line 89
static
setStyleDefinition(string $name, TableStyle $style)
Sets a style definition.
at line line 105
static TableStyle
getStyleDefinition(string $name)
Gets a style definition by name.
at line line 125
Table
setStyle(TableStyle|string $name)
Sets table style.
at line line 143
TableStyle
getStyle()
Gets the current table style.
at line line 156
Table
setColumnStyle(int $columnIndex, TableStyle|string $name)
Sets table column style.
at line line 180
TableStyle
getColumnStyle(int $columnIndex)
Gets the current style for a column.
If style was not set, it returns the global table style.
at line line 189
setHeaders(array $headers)
at line line 201
setRows(array $rows)
at line line 208
addRows(array $rows)
at line line 217
addRow($row)
at line line 234
setRow($column, array $row)
at line line 253
render()
Renders table to output.
Example: +---------------+-----------------------+------------------+ | ISBN | Title | Author | +---------------+-----------------------+------------------+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri | | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | +---------------+-----------------------+------------------+