Zend\Text\Table\Table enables developers to create tables out of characters

 Methods

Create a basic table object

__construct(array | \Traversable $options) 

Parameters

$options

array\Traversable

Configuration options

Exceptions

\Zend\Text\Table\Exception\UnexpectedValueException When no columns widths were set

Magic method which returns the rendered table

__toString() : string

Returns

string

Append a row to the table

appendRow(array | \Zend\Text\Table\Row $row) : \Zend\Text\Table\Table

Parameters

$row

array\Zend\Text\Table\Row

The row to append to the table

Exceptions

\Zend\Text\Table\Exception\InvalidArgumentException When $row is neither an array nor Zend\Text\Table\Row
\Zend\Text\Table\Exception\OverflowException When a row contains too many columns

Returns

Get the plugin manager for decorators

getDecoratorManager() : \Zend\Text\Table\DecoratorManager

Get the input charset for column contents

getInputCharset() : string

Returns

string

Get the output charset for column contents

getOutputCharset() : string

Returns

string

Render the table

render() : string

Exceptions

\Zend\Text\Table\Exception\UnexpectedValueException When no rows were added to the table

Returns

string

Set auto separation mode

setAutoSeparate(int $autoSeparate) : \Zend\Text\Table\Table

Parameters

$autoSeparate

int

Auto separation mode

Returns

Set column widths

setColumnWidths(array $columnWidths) : \Zend\Text\Table\Table

Parameters

$columnWidths

array

Widths of all columns

Exceptions

\Zend\Text\Table\Exception\InvalidArgumentException When no columns were supplied
\Zend\Text\Table\Exception\InvalidArgumentException When a column has an invalid width

Returns

Set decorator

setDecorator(\Zend\Text\Table\Decorator\DecoratorInterface | string $decorator) : \Zend\Text\Table\Table

Parameters

$decorator

\Zend\Text\Table\Decorator\DecoratorInterfacestring

Decorator to use

Returns

Set the plugin manager instance for decorators

setDecoratorManager(\Zend\Text\Table\DecoratorManager $decoratorManager) : \Zend\Text\Table\Table

Parameters

Returns

Set default column align for rows created by appendRow(array $data)

setDefaultColumnAlign(int $columnNum, string $align) : \Zend\Text\Table\Table

Parameters

$columnNum

int

$align

string

Returns

Set the input charset for column contents

setInputCharset(string $charset) 

Parameters

$charset

string

Set options from array

setOptions(array $options) : \Zend\Text\Table\Table

Parameters

$options

array

Configuration for Table

Returns

Set the output charset for column contents

setOutputCharset(string $charset) 

Parameters

$charset

string

Set the column padding

setPadding(int $padding) : \Zend\Text\Table\Table

Parameters

$padding

int

The padding for the columns

Returns

 Properties

 

Auto separation mode

$autoSeparate : int

 

List of all column widths

$columnWidths : array

 

Decorator used for the table borders

$decorator : \Zend\Text\Table\Decorator\DecoratorInterface

 

Plugin loader for decorators

$decoratorManager : \Zend\Text\Table\DecoratorManager

 

Default column aligns for rows created by appendRow(array $data)

$defaultColumnAligns : array

 

Charset which is used for input by default

$inputCharset : string

 

Charset which is used internally

$outputCharset : string

 

Padding for columns

$padding : int

 

Rows of the table

$rows : array

 

Option keys to skip when calling setOptions()

$skipOptions : array

 Constants

 

AUTO_SEPARATE_ALL

AUTO_SEPARATE_ALL 

   

AUTO_SEPARATE_HEADER

AUTO_SEPARATE_HEADER 

 

Auto separator settings

AUTO_SEPARATE_NONE