Column class for Zend\Text\Table\Row

 Methods

Create a column for a Zend\Text\Table\Row object.

__construct(string $content, string $align, int $colSpan, string $charset) 

Parameters

$content

string

The content of the column

$align

string

The align of the content

$colSpan

int

The colspan of the column

$charset

string

The encoding of the content

Get the colspan

getColSpan() : int

Returns

int

Render the column width the given column width

render(int $columnWidth, int $padding) : string

Parameters

$columnWidth

int

The width of the column

$padding

int

The padding for the column

Exceptions

\Zend\Text\Table\Exception\InvalidArgumentException When $columnWidth is lower than 1
\Zend\Text\Table\Exception\OutOfBoundsException When padding is greater than columnWidth

Returns

string

Set the align

setAlign(string $align) : \Zend\Text\Table\Column

Parameters

$align

string

Align of the column

Exceptions

\Zend\Text\Table\Exception\OutOfBoundsException When supplied align is invalid

Returns

Set the colspan

setColSpan(int $colSpan) : \Zend\Text\Table\Column

Parameters

$colSpan

int

Exceptions

\Zend\Text\Table\Exception\InvalidArgumentException When $colSpan is smaller than 1

Returns

Set the content.

setContent(string $content, string $charset) : \Zend\Text\Table\Column

If $charset is not defined, it is assumed that $content is encoded in the charset defined via Zend\Text\Table::setInputCharset() (defaults to utf-8).

Parameters

$content

string

Content of the column

$charset

string

The charset of the content

Exceptions

\Zend\Text\Table\Exception\InvalidArgumentException When $content is not a string

Returns

 Properties

 

Align of the column

$align : string

 

Allowed align parameters

$allowedAligns : array

 

Colspan of the column

$colSpan : int

 

Content of the column

$content : string

 Constants

 

ALIGN_CENTER

ALIGN_CENTER 

 

Aligns for columns

ALIGN_LEFT 

 

ALIGN_RIGHT

ALIGN_RIGHT