Class Symfony\Component\Console\Helper\Table

InheritanceSymfony\Component\Console\Helper\Table

Provides helpers to display a table.

Method Details

__construct() public method

public void __construct ( Symfony\Component\Console\Output\OutputInterface $output )
$output
addRow() public method

public void addRow ( $row )
$row
addRows() public method

public void addRows ( array $rows )
$rows
getColumnStyle() public method

Gets the current style for a column.

If style was not set, it returns the global table style.

public Symfony\Component\Console\Helper\TableStyle getColumnStyle ( $columnIndex )
$columnIndex int

Column index

getStyle() public method

Gets the current table style.

public Symfony\Component\Console\Helper\TableStyle getStyle ( )
getStyleDefinition() public static method

Gets a style definition by name.

public static Symfony\Component\Console\Helper\TableStyle getStyleDefinition ( $name )
$name string

The style name

return Symfony\Component\Console\Helper\TableStyle

A TableStyle instance

render() public method

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 | +---------------+-----------------------+------------------+

public void render ( )
setColumnStyle() public method

Sets table column style.

public Symfony\Component\Console\Helper\Table setColumnStyle ( $columnIndex, $name )
$columnIndex int

Column index

$name Symfony\Component\Console\Helper\TableStyle|string

The style name or a TableStyle instance

setColumnWidth() public method

Sets the minimum width of a column.

public Symfony\Component\Console\Helper\Table setColumnWidth ( $columnIndex, $width )
$columnIndex int

Column index

$width int

Minimum column width in characters

setColumnWidths() public method

Sets the minimum width of all columns.

public Symfony\Component\Console\Helper\Table setColumnWidths ( array $widths )
$widths array
setHeaders() public method

public void setHeaders ( array $headers )
$headers
setRow() public method

public void setRow ( $column, array $row )
$column
$row
setRows() public method

public void setRows ( array $rows )
$rows
setStyle() public method

Sets table style.

public Symfony\Component\Console\Helper\Table setStyle ( $name )
$name Symfony\Component\Console\Helper\TableStyle|string

The style name or a TableStyle instance

setStyleDefinition() public static method

Sets a style definition.

public static void setStyleDefinition ( $name, Symfony\Component\Console\Helper\TableStyle $style )
$name string

The style name

$style Symfony\Component\Console\Helper\TableStyle

A TableStyle instance