## Apache Zeta Components Manual :: Docs For Class ezcDocumentDocbookToRstTableHandler

### Document::ezcDocumentDocbookToRstTableHandler

### Class ezcDocumentDocbookToRstTableHandler

Visit tables

The RST table rendering algorithm tries losely to fit a table in the provided document dimensions. This may not always work for over long words, or if the table cells contain literal blocks which can not be wrapped.

For this the algorithm estiamtes the available width per column, equally distributes this available width over all columns (which might be far from optimal), and extends the total table width if some cell content exceeds the column width.

The initial table cell estiation happens inside the function estimateColumnWidths() which you might want to extend to fit your needs better.

Source for this file: /Document/src/converters/element_visitor/docbook/rst/table.php

    ezcDocumentElementVisitorHandler
       |
       --ezcDocumentDocbookToRstBaseHandler
          |
          --ezcDocumentDocbookToRstTableHandler

Version: | //autogen//

### Method Summary

protected array | `estimateColumnWidths( $converter , $table )` Estimation of table column widths
protected int | `getMaxLineLength( $lines )` Get maximum line length
public mixed | `handle( $converter , $node , $root )` Handle a node

### Inherited Methods

From ezcDocumentDocbookToRstBaseHandler
protected string | `ezcDocumentDocbookToRstBaseHandler::renderDirective()` Render a directive
From ezcDocumentElementVisitorHandler
public abstract mixed | `ezcDocumentElementVisitorHandler::handle()` Handle a node.

### Methods

#### estimateColumnWidths

array estimateColumnWidths( ezcDocumentElementVisitorConverter $converter , $table )

Estimation of table column widths

Returns an spoecification array with the column widths for the tables, which will be generated by this class. The array should contain as many values as the table contains columns, each specifying the width of the respective column.

This basic implementation just divides the document width (specified by the wordwrap option in the converter class) by the amount of columns found in the given table. This might be far from optimal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$converter` | ezcDocumentElementVisitorConverter |
`$table` | DOMElement |

#### getMaxLineLength

int getMaxLineLength( $lines )

Get maximum line length

Calculate the maximum line length from an array of textual lines.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$lines` | array |

#### handle

mixed handle( ezcDocumentElementVisitorConverter $converter , $node , mixed $root )

Handle a node

Handle / transform a given node, and return the result of the conversion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$converter` | ezcDocumentElementVisitorConverter |
`$node` | DOMElement |
`$root` | mixed |

##### Redefinition of:

Method | Description
--- | ---
`ezcDocumentElementVisitorHandler::handle()` | Handle a node.

Documentation generated by phpDocumentor 1.4.3