Class Table

Description

Class for creating tables.

Located in /Table.php (line 6)


	
			
Variable Summary
mixed $alignment
mixed $cells
mixed $columns
mixed $container
mixed $keep
mixed $rows
mixed $rtf
Method Summary
Table Table ( &$container, [ $alignment = 'left'])
void addColumn (float $width)
void addColumnsList (array $array)
Image &addImageToCell ($row $row, $column $column, string $fileName,  &$parFormat, [float $width = 0], [float $height = 0], mix $parFormat)
void addRow ([float $height = 0])
void addRows (int $count, [float $height = 0])
void addRowsList (array $array)
Cell &getCell (int $row, int $column)
string getContent ()
void mergeCells (int $startRow, int $startColumn, int $endRow, int $endColumn)
void rotateCells ($startRow $direction, $startColumn $startRow, $endRow $startColumn, [$endColumn $endRow = 0], [$direction $endColumn = 0])
void setBackGroundOfCells (string $backColor, $startRow $startRow, $startColumn $startColumn, [$endRow $endRow = 0], [$endColumn $endColumn = 0])
void setBordersOfCells (BorderFormat &$borderFormat, $startRow $startRow, $startColumn $startColumn, [$endRow $endRow = 0], [$endColumn $endColumn = 0], [boolean $left = true], [boolean $top = true], [boolean $right = true], [boolean $bottom = true])
void setDefaultAlignmentOfCells ($alignment $alignment, $startRow $startRow, $startColumn $startColumn, [$endRow $endRow = 0], [$endColumn $endColumn = 0])
void setDefaultFontOfCells ($font &$font, $startRow $startRow, $startColumn $startColumn, [$endRow $endRow = 0], [$endColumn $endColumn = 0])
void setLeftPosition (float $leftPosition)
void setVerticalAlignmentOfCells ($verticalAlignment $verticalAlignment, $startRow $startRow, $startColumn $startColumn, [$endRow $endRow = 0], [$endColumn $endColumn = 0])
void writeToCell ($row $row, $column $column, string $text,  &$font,  &$parFormat, [boolen $replaceTags = true], Font $font, mix $parFormat)
Variables
mixed $alignment (line 22)

Internal use.

  • access: public
mixed $cells (line 20)

Internal use.

  • access: public
mixed $columns (line 18)

Internal use.

  • access: public
mixed $container (line 14)

Internal use.

  • access: public
mixed $firstRowHeader (line 26)

Internal use.

  • access: public
mixed $keep (line 24)

Internal use.

  • access: public
mixed $leftPosition = 0 (line 28)

Internal use.

  • access: public
mixed $rows (line 16)

Internal use.

  • access: public
mixed $rtf (line 12)

Internal use.

  • access: public
Methods
Constructor Table (line 35)

Constructor. Internal use.

  • access: public
Table Table ( &$container, [ $alignment = 'left'])
  • &$container
  • $alignment
addColumn (line 129)

Adds column to a table.

  • access: public
void addColumn (float $width)
  • float $width: Width of column.
addColumnsList (line 142)

Adds list of columns to a table.

  • access: public
void addColumnsList (array $array)
  • array $array: Array of column widths.
addImageToCell (line 187)

Adds image to cell.

  • access: public
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
addRow (line 89)

Adds row to a table.

  • todo: doc
  • access: public
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.
addRows (line 118)

Adds rows to a table.

  • access: public
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.
addRowsList (line 106)

Adds list of rows to a table.

  • access: public
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.
getCell (line 155)

Gets the instance of cell.

  • access: public
Cell &getCell (int $row, int $column)
  • int $row
  • int $column
getContent (line 457)

Gets rtf code of Table object. Internal use.

  • access: public
string getContent ()
mergeCells (line 372)

Merges cells of table.

  • access: public
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
rotateCells (line 300)

Rotates cells.

  • access: public
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.
setBackGroundOfCells (line 323)

Sets background color of cells.

  • access: public
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.
setBordersOfCells (line 350)

Sets borders of cells.

  • access: public
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.
setDefaultAlignmentOfCells (line 252)

Sets alignments of empty cells.

  • access: public
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.
setDefaultFontOfCells (line 275)

Sets default font of empty cells.

  • access: public
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.
setFirstRowAsHeader (line 70)

Sets the first row of table as header. This row is repeated at the top of each page.

  • access: public
void setFirstRowAsHeader ()
setLeftPosition (line 79)

Sets left position of table.

  • access: public
void setLeftPosition (float $leftPosition)
  • float $leftPosition: Left position of table.
setRowsKeepTogether (line 62)

Sets that the table row is not splited by a page break. By default page break splits table row.

  • access: public
void setRowsKeepTogether ()
setVerticalAlignmentOfCells (line 224)

Sets vertical alignment of cells.

  • access: public
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.
writeToCell (line 169)

Writes text to cell.

  • access: public
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

Documentation generated on Fri, 25 Jan 2008 23:10:52 +0200 by phpDocumentor 1.3.1