Property | Type | Description | |
---|---|---|---|
$_alignment | string | ||
$_columns | PHPRtfLite_Table_Column[] | array of PHPRtfLite_Table_Column instances | |
$_container | PHPRtfLite_Container | ||
$_firstRowIsHeader | boolean | ||
$_leftPosition | integer | ||
$_nestDepth | integer | .. and so on .. | |
$_preventEmptyParagraph | boolean | flag for preventing an empty paragraph after table | |
$_preventPageBreak | boolean | ||
$_repeatFirstRowHeader | boolean | ||
$_rows | PHPRtfLite_Table_Row[] | array of PHPRtfLite_Table_Row instances |
Method | Description | |
---|---|---|
__construct ( PHPRtfLite_Container_Base $container, string $alignment = self::ALIGN_LEFT, integer $nestDepth = 1 ) | constructor | |
addColumn ( float $width ) : PHPRtfLite_Table_Column | adds column | |
addColumnsList ( $columnWidths ) | adds list of columns | |
addImageFromStringToCell ( integer $rowIndex, integer $columnIndex, string $imageString, string $type, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image | adds image to cell | |
addImageToCell ( integer $rowIndex, integer $columnIndex, string $file, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image | adds image to cell | |
addRow ( float $height = null ) : PHPRtfLite_Table_Row | adds row | |
addRowList ( array $heights ) | adds list of rows to a table. | |
addRows ( integer $rowCnt, float $height = null ) | adds rows | |
checkColumnIndex ( integer $colIndex ) : boolean | returns true, if column index is valid | |
checkIfCellExists ( integer $rowIndex, integer $columnIndex ) : boolean | returns true, if rowIndex and columnIndex do exists in table | |
checkRowIndex ( integer $rowIndex ) : boolean | returns true, if row index is valid | |
free ( ) | ||
getAlignment ( ) : string | gets alignment | |
getCell ( integer $rowIndex, integer $columnIndex ) : PHPRtfLite_Table_Cell | gets the instance of cell | |
getColumn ( integer $colIndex ) : PHPRtfLite_Table_Column | gets column | |
getColumns ( ) : PHPRtfLite_Table_Column[] | gets table columns | |
getColumnsCount ( ) : integer | gets number of columns in table | |
getContainer ( ) : PHPRtfLite_Container | gets rtf container instance | |
getLeftPosition ( ) : float | gets left position of table | |
getNestDepth ( ) : integer | gets nested depth | |
getPreventEmptyParagraph ( ) : boolean | returns true, if no empty paragraph should be added after table | |
getRow ( integer $rowIndex ) : PHPRtfLite_Table_Row | gets row instance | |
getRows ( ) : PHPRtfLite_Table_Row[] | gets table rows | |
getRowsCount ( ) : integer | gets number of rows in table | |
getRtf ( ) : PHPRtfLite | gets rtf instance | |
isFirstRowHeader ( ) : boolean | Returns true, if first row should be used as header. First row will be repeated at the top of each page. | |
isNestedTable ( ) : boolean | checks, if table is a nested table | |
isPreventPageBreak ( ) : boolean | returns true, if a table should not be splited by a page break | |
mergeCellRange ( integer $startRow, integer $startColumn, integer $endRow, integer $endColumn ) | merges cells of a given cell range | |
preventEmptyParagraph ( $value = true ) | prevents adding an empty paragraph after table | |
render ( ) : string | gets rtf code for table | |
renderRowDefinition ( PHPRtfLite_Table_Row $row ) | renders row definition | |
rotateCellRange ( string $rotateTo, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | rotates cells of a given cell range | |
setBackgroundForCellRange ( string $backgroundColor, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | sets background color of cells of a given cell range | |
setBorderForCellRange ( PHPRtfLite_Border $border, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | sets border to cells of a given cell range | |
setBordersForCellRange ( PHPRtfLite_Border_Format $borderFormat, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null, boolean $left = true, boolean $top = true, boolean $right = true, boolean $bottom = true ) | ||
setFirstRowAsHeader ( ) | Sets first row as header row. First row will be repeated at the top of each page. | |
setFontForCellRange ( PHPRtfLite_Font $font, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | sets font to empty cells of a given cell range | |
setLeftPosition ( float $leftPosition ) | sets left position of table | |
setPreventPageBreak ( ) | Sets that table won't be splited by a page break. By default page break splits table. | |
setTextAlignmentForCellRange ( string $alignment, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | sets alignments to empty cells of a given cell range | |
setVerticalAlignmentForCellRange ( string $verticalAlignment, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | sets vertical alignment to cells of a given cell range | |
writeToCell ( integer $rowIndex, integer $columnIndex, string $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, boolean $convertTagsToRtf = true ) : PHPRtfLite_Element | writes text to cell |
Method | Description | |
---|---|---|
renderRowCells ( PHPRtfLite_Table_Row $row ) | renders row cells |
Method | Description | |
---|---|---|
getCellsByCellRange ( integer $startRow, integer $startColumn, integer $endRow, integer $endColumn ) : PHPRtfLite_Table_Cell[] | ||
getValidCellRange ( integer $startRow, integer $startColumn, integer $endRow, integer $endColumn ) : array | corrects cell range to be valid |
public __construct ( PHPRtfLite_Container_Base $container, string $alignment = self::ALIGN_LEFT, integer $nestDepth = 1 ) | ||
$container | PHPRtfLite_Container_Base | |
$alignment | string | |
$nestDepth | integer |
public addImageFromStringToCell ( integer $rowIndex, integer $columnIndex, string $imageString, string $type, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image | ||
$rowIndex | integer | row index of cell |
$columnIndex | integer | column index of cell |
$imageString | string | image source code |
$type | string | image type (GD, WMF) |
$parFormat | PHPRtfLite_ParFormat | paragraph format |
$width | float | if null image is displayed by it's original height. |
$height | float | if null image is displayed by it's original width. If boths parameters are null, image is displayed as it is. |
return | PHPRtfLite_Image |
public addImageToCell ( integer $rowIndex, integer $columnIndex, string $file, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image | ||
$rowIndex | integer | row index of cell |
$columnIndex | integer | column index of cell |
$file | string | image file. |
$parFormat | PHPRtfLite_ParFormat | paragraph format |
$width | float | if null image is displayed by it's original height. |
$height | float | if null image is displayed by it's original width. If boths parameters are null, image is displayed as it is. |
return | PHPRtfLite_Image |
public addRow ( float $height = null ) : PHPRtfLite_Table_Row | ||
$height | float | row height. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line. |
return | PHPRtfLite_Table_Row |
public addRowList ( array $heights ) | ||
$heights | array | array of heights for each row to add. When height is null, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line. |
public addRows ( integer $rowCnt, float $height = null ) | ||
$rowCnt | integer | |
$height | float | row height. When null, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line. |
public checkColumnIndex ( integer $colIndex ) : boolean | ||
$colIndex | integer | |
return | boolean |
public checkRowIndex ( integer $rowIndex ) : boolean | ||
$rowIndex | integer | |
return | boolean |
public getColumns ( ) : PHPRtfLite_Table_Column[] | ||
return | PHPRtfLite_Table_Column[] |
public getColumnsCount ( ) : integer | ||
return | integer |
public getContainer ( ) : PHPRtfLite_Container | ||
return | PHPRtfLite_Container |
public getLeftPosition ( ) : float | ||
return | float |
public getPreventEmptyParagraph ( ) : boolean | ||
return | boolean |
public getRows ( ) : PHPRtfLite_Table_Row[] | ||
return | PHPRtfLite_Table_Row[] |
public getRowsCount ( ) : integer | ||
return | integer |
public isFirstRowHeader ( ) : boolean | ||
return | boolean |
public isNestedTable ( ) : boolean | ||
return | boolean |
public isPreventPageBreak ( ) : boolean | ||
return | boolean |
public preventEmptyParagraph ( $value = true ) |
protected renderRowCells ( PHPRtfLite_Table_Row $row ) | ||
$row | PHPRtfLite_Table_Row |
public renderRowDefinition ( PHPRtfLite_Table_Row $row ) | ||
$row | PHPRtfLite_Table_Row |
public rotateCellRange ( string $rotateTo, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$rotateTo | string | direction of rotation Possible values (represented by PHPRtfLite_Table_Cell::ROTATE_*): PHPRtfLite_Table_Cell::ROTATE_RIGHT => 'right' PHPRtfLite_Table_Cell::ROTATE_LEFT => 'left' |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then rotation is set only to the row range. |
$endColumn | integer | end column, if null, then rotation is set just to the column range. |
public setBackgroundForCellRange ( string $backgroundColor, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$backgroundColor | string | background color |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then rotation is set only to the row range. |
$endColumn | integer | end column, if null, then rotation is set just to the column range. |
public setBorderForCellRange ( PHPRtfLite_Border $border, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$border | PHPRtfLite_Border | border |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then border is set only to the row range. |
$endColumn | integer | end column, if null, then border is set just to the column range. |
public setBordersForCellRange ( PHPRtfLite_Border_Format $borderFormat, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null, boolean $left = true, boolean $top = true, boolean $right = true, boolean $bottom = true ) | ||
$borderFormat | PHPRtfLite_Border_Format | border format |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then border is set only to the row range. |
$endColumn | integer | end column, if null, then border is set just to the column range. |
$left | boolean | if false, left border is not set (default true) |
$top | boolean | if false, top border is not set (default true) |
$right | boolean | if false, right border is not set (default true) |
$bottom | boolean | if false, bottom border is not set (default true) |
public setFirstRowAsHeader ( ) |
public setFontForCellRange ( PHPRtfLite_Font $font, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$font | PHPRtfLite_Font | font for empty cells. The method PHPRtfLite_Table_Cell->writeToCell() overrides it with another PHPRtfLite_Font. |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then font is set only to the row range. |
$endColumn | integer | end column, if null, then font is set just to the column range. |
public setLeftPosition ( float $leftPosition ) | ||
$leftPosition | float | left position of table. |
public setPreventPageBreak ( ) |
public setTextAlignmentForCellRange ( string $alignment, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$alignment | string | alignment of cell. The method PHPRtfLite_Table_Cell->writeToCell() overrides it with PHPRtfLite_ParFormat alignment. Alignment is represented by class constants PHPRtfLite_Container::TEXT_ALIGN_* Possible values: PHPRtfLite_Container::TEXT_ALIGN_LEFT => 'left' - left alignment PHPRtfLite_Container::TEXT_ALIGN_RIGHT => 'right' - right alignment PHPRtfLite_Container::TEXT_ALIGN_CENTER => 'center' - center alignment PHPRtfLite_Container::TEXT_ALIGN_JUSTIFY => 'justify' - justify alignment |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then text alignment is set only to the row range. |
$endColumn | integer | end column, if null, then text alignment is set just to the column range. |
public setVerticalAlignmentForCellRange ( string $verticalAlignment, integer $startRow, integer $startColumn, integer $endRow = null, integer $endColumn = null ) | ||
$verticalAlignment | string | Vertical alignment of cell (default top). Represented by PHPRtfLite_Container::VERTICAL_ALIGN_* Possible values: PHPRtfLite_Container::VERTICAL_ALIGN_TOP => 'top' - top alignment; PHPRtfLite_Container::VERTICAL_ALIGN_CENTER => 'center' - center alignment; PHPRtfLite_Container::VERTICAL_ALIGN_BOTTOM => 'bottom' - bottom alignment. |
$startRow | integer | start row |
$startColumn | integer | start column |
$endRow | integer | end row, if null, then vertical alignment is set only to the row range. |
$endColumn | integer | end column, if null, then vertical alignment is set just to the column range. |
public writeToCell ( integer $rowIndex, integer $columnIndex, string $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, boolean $convertTagsToRtf = true ) : PHPRtfLite_Element | ||
$rowIndex | integer | row index of cell |
$columnIndex | integer | column index of cell |
$text | string | Text. Also you can use html style tags. @see PHPRtfLite_Container#writeText() |
$font | PHPRtfLite_Font | Font of text |
$parFormat | PHPRtfLite_ParFormat | Paragraph format |
$convertTagsToRtf | boolean | If false, then html style tags are not replaced with rtf code. |
return | PHPRtfLite_Element |
protected PHPRtfLite_Table_Column[] $_columns | ||
return | PHPRtfLite_Table_Column[] |
protected PHPRtfLite_Container $_container | ||
return | PHPRtfLite_Container |
protected bool $_preventEmptyParagraph | ||
return | boolean |