Column class for Zend\Text\Table\Row

package Default

 Methods

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

__construct(string $content = null, string $align = null, integer $colSpan = null, string $charset = null

Parameters

$content

string

The content of the column

$align

string

The align of the content

$colSpan

integer

The colspan of the column

$charset

string

The encoding of the content

Get the colspan

getColSpan() : integer

Returns

integer

Render the column width the given column width

render(integer $columnWidth, integer $padding = 0) : string

Parameters

$columnWidth

integer

The width of the column

$padding

integer

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

\Zend\Text\Table\Column

Set the colspan

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

Parameters

$colSpan

integer

Exceptions

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

Returns

\Zend\Text\Table\Column

Set the content.

setContent(string $content, string $charset = null) : \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

\Zend\Text\Table\Column

 Properties

 

Align of the column

$align : string

Default

self::ALIGN_LEFT
 

Allowed align parameters

$allowedAligns : array

Default

array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)
 

Colspan of the column

$colSpan : integer

Default

1
 

Content of the column

$content : string

Default

''

 Constants

 

ALIGN_CENTER

ALIGN_CENTER = 'center' 
 

Aligns for columns

ALIGN_LEFT = 'left' 
 

ALIGN_RIGHT

ALIGN_RIGHT = 'right'