Constructor. Internal use.
Table
Table
( &$container, [ $alignment = 'left'])
Adds column to a table.
void
addColumn
(float $width)
-
float
$width: Width of column.
Adds list of columns to a table.
void
addColumnsList
(array $array)
-
array
$array: Array of column widths.
Adds image to cell.
Image
&addImageToCell
(
$row $row,
$column $column,
string $fileName,
&$parFormat,
float $width,
float $height,
mix $parFormat)
-
string
$fileName: Name of image file.
-
mix
$parFormat
-
float
$width: Default 0. If 0 image is displayed by it's height.
-
float
$height: Default 0. If 0 image is displayed by it' width. If boths parameters are 0, image is displayed as is.
-
$row
$row: Vertical position of cell
-
$column
$column: Horizontal position of cell
-
&$parFormat
Adds row to a table.
void
addRow
(float $height)
-
float
$height: height Height of table row. 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.
Adds rows to a table.
void
addRows
(int $count, float $height)
-
int
$count: Count of rows.
-
float
$height: Height of row. 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.
Adds list of rows to a table.
void
addRowsList
(array $array)
-
array
$array: Array of heights of rows. When height is 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.
Gets the instance of cell.
Cell
&getCell
(
int $row,
int $column)
Gets rtf code of Table object. Internal use.
string
getContent
()
Merges cells of table.
void
mergeCells
(int $startRow, int $startColumn, int $endRow, int $endColumn)
-
int
$startRow: Start row
-
int
$startColumn: Start column
-
int
$endRow: End row
-
int
$endColumn: End column
Rotates cells.
void
rotateCells
($startRow $direction, $startColumn $startRow, $endRow $startColumn, $endColumn $endRow, $direction $endColumn)
-
$startRow
$direction: Start row.
-
$startColumn
$startRow: Start column.
-
$endRow
$startColumn: End row. If 0, then cells of just one row are rotated.
-
$endColumn
$endRow: End column. If 0, then cells of just on column are rotated.
-
$direction
$endColumn: Direction of rotation. Possible values: 'right' => right; 'left' => left.
Sets background color of cells.
void
setBackGroundOfCells
(string $backColor, $startRow $startRow, $startColumn $startColumn, $endRow $endRow, $endColumn $endColumn)
-
string
$backColor: Colour of background
-
$startRow
$startRow: Start row
-
$startColumn
$startColumn: Star column
-
$endRow
$endRow: End row. If 0, then background color is set just for one row cells.
-
$endColumn
$endColumn: End column. If 0, then background color is set just for one column cells.
Sets borders of cells.
void
setBordersOfCells
(
BorderFormat &$borderFormat,
$startRow $startRow,
$startColumn $startColumn,
$endRow $endRow,
$endColumn $endColumn, [
boolean $left =
true], [
boolean $top =
true], [
boolean $right =
true], [
boolean $bottom =
true])
-
BorderFormat
&$borderFormat: Border format
-
boolean
$left: If false, left border is not set (default true)
-
boolean
$top: If false, top border is not set (default true)
-
boolean
$right: If false, right border is not set (default true)
-
boolean
$bottom: If false, bottom border is not set (default true)
-
$startRow
$startRow: Start row
-
$startColumn
$startColumn: Start column
-
$endRow
$endRow: End row. If 0, then border format is set just for one row cells.
-
$endColumn
$endColumn: End column. If 0, then border format is set just for one column cells.
Sets alignments of empty cells.
void
setDefaultAlignmentOfCells
($alignment $alignment, $startRow $startRow, $startColumn $startColumn, $endRow $endRow, $endColumn $endColumn)
-
$alignment
$alignment: Alignment of cell (default top). The method Cell::writeToCell overrides it with ParFormat alignment. Possible values:
'left' => left alignment;
'center' => center alignment;
'right' => right alignment;
'justify' => justify alignment.
-
$startRow
$startRow: Start row
-
$startColumn
$startColumn: Start column
-
$endRow
$endRow: End row. If 0, then default alignment is set just for one row cells.
-
$endColumn
$endColumn: End column. If 0, then default alignment is set just for one column cells.
Sets default font of empty cells.
void
setDefaultFontOfCells
($font &$font, $startRow $startRow, $startColumn $startColumn, $endRow $endRow, $endColumn $endColumn)
-
$font
&$font: Default font of empty cell. The method Cell::writeToCell overrides it with another Font.
-
$startRow
$startRow: Start row.
-
$startColumn
$startColumn: Start column.
-
$endRow
$endRow: End row. If 0, default font is set just for one row cells.
-
$endColumn
$endColumn: End column. If 0, default font is set just for one column cells.
Sets the first row of table as header. This row is repeated at the top of each page.
void
setFirstRowAsHeader
()
Sets left position of table.
void
setLeftPosition
(float $leftPosition)
-
float
$leftPosition: Left position of table.
Sets that the table row is not splited by a page break. By default page break splits table row.
void
setRowsKeepTogether
()
Sets vertical alignment of cells.
void
setVerticalAlignmentOfCells
($verticalAlignment $verticalAlignment, $startRow $startRow, $startColumn $startColumn, $endRow $endRow, $endColumn $endColumn)
-
$verticalAlignment
$verticalAlignment: Vertical alignment of cell (default top). Possible values:
'top' => top alignment;
'center' => center alignment;
'bottom' => bottom alignment.
-
$startRow
$startRow: Start row
-
$startColumn
$startColumn: Start column
-
$endRow
$endRow: End row . If 0, then vertical alignment is set just for one row cells.
-
$endColumn
$endColumn: End column . If 0, then vertical alignment is set just for one column cells.
Writes text to cell.
void
writeToCell
(
$row $row,
$column $column,
string $text,
&$font,
&$parFormat, [
boolen $replaceTags =
true],
Font $font,
mix $parFormat)
-
string
$text: Text. Also you can use html style tags. @see Container::writeText()
-
Font
$font: Font of text
-
mix
$parFormat: Paragraph format or null object.
-
boolen
$replaceTags: If false, then html style tags are not replaced with rtf code.
-
$row
$row: Vertical position of cell
-
$column
$column: Horizontal position of cell
-
&$font
-
&$parFormat