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

package Default

 Methods

Create a basic table object

__construct(array|\Traversable $options = null

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

\Zend\Text\Table\Table

Get the plugin manager for decorators

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

Returns

\Zend\Text\Table\DecoratorManager

Get the input charset for column contents

getInputCharset() : string
Static

Returns

string

Get the output charset for column contents

getOutputCharset() : string
Static

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(integer $autoSeparate) : \Zend\Text\Table\Table

Parameters

$autoSeparate

integer

Auto separation mode

Returns

\Zend\Text\Table\Table

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

\Zend\Text\Table\Table

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

\Zend\Text\Table\Table

Set the plugin manager instance for decorators

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

Parameters

$decoratorManager

\Zend\Text\Table\DecoratorManager

Returns

\Zend\Text\Table\Table

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

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

Parameters

$columnNum

integer

$align

string

Returns

\Zend\Text\Table\Table

Set the input charset for column contents

setInputCharset(string $charset) 
Static

Parameters

$charset

string

Set options from array

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

Parameters

$options

array

Configuration for Table

Returns

\Zend\Text\Table\Table

Set the output charset for column contents

setOutputCharset(string $charset) 
Static

Parameters

$charset

string

Set the column padding

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

Parameters

$padding

integer

The padding for the columns

Returns

\Zend\Text\Table\Table

 Properties

 

Auto separation mode

$autoSeparate : integer

Default

self::AUTO_SEPARATE_ALL
 

List of all column widths

$columnWidths : array

Default

null
 

Decorator used for the table borders

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

Default

null
 

Plugin loader for decorators

$decoratorManager : \Zend\Text\Table\DecoratorManager

Default

null
 

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

$defaultColumnAligns : array

Default

array()
 

Charset which is used for input by default

$inputCharset : string

Default

'utf-8'
Static
 

Charset which is used internally

$outputCharset : string

Default

'utf-8'
Static
 

Padding for columns

$padding : integer

Default

0
 

Rows of the table

$rows : array

Default

array()
 

Option keys to skip when calling setOptions()

$skipOptions : array

Default

array('options', 'config', 'defaultColumnAlign')

 Constants

 

AUTO_SEPARATE_ALL

AUTO_SEPARATE_ALL = 4 
   

AUTO_SEPARATE_HEADER

AUTO_SEPARATE_HEADER = 1 
 

Auto separator settings

AUTO_SEPARATE_NONE = 0