Classtrees
 

rtfTable

rtfTable

private class rtfTable

This class provides an API for creating tables in RTF format.
It is instantiated by the createTable method of the rtfFile.class

AuthorsNicolas de Haen <mail@ndh-websolutions.de>
Version0.7 alpha

 
 

Public Method Summary

void

setBorder(int $left, int $top, int$right, int $bottom)

sets the actual border width
void

addRow()

adds a row to the table
void

setRowProperties(string $width,string $bgColors, string $borders,string $alignment, int $padding)

sets the properties for the actual and following rows

string

getString()

returns the string of the created table

Private Method Summary

void

rtfTable(int $cols, int $width, string $align,int $left, int $colorCount, string $bgcolor)

Constructor
void

getHeader()

Private Field Summary

string

$content

string

$border

string

$align

array

$rows

string

$cellString

integer

$cols

integer

$aktCols

string

$left

string

$width

integer

$pageWidth

integer

$colorCount

boolean

$bgcolor

array

$arrAlignment

Public Method Details

setBorder

public void setBorder(int $left, int $top, int$right, int $bottom)

Parameter
int $left

left border width
int $top

top border width
int $right

right border width
int $bottom

bottom border width
  sets the actual border width

Returns void

 

addRow

public void addRow( )

  adds a row to the table
expects a string for each cell in a row

Returns void

 

setRowProperties

public void setRowProperties( string $width,string $bgColors, string $borders,string $alignment, int $padding)

Parameter
 
string $width
width of the cells in percent as comma seperated string
(sum must be 100)
 
string $bgColors
HEX values of the background colors of the cells as comma seperated string, if only one value is passed it will be used for the whole row
 
string $borders
border of the cells, usage:
"b_left_cell1, b_top_cell1, b_right_cell1, b_bottom_cell1;b_left_cell2, b_top_cell2, b_right_cell2, b_bottom_cell2" etc.
 
string $alignement
comma separated values
example: "left,right,center,left"
 
int $padding
value for the padding
  sets the properties for the actual and following rows
each of the arguments is either

Returns void

 

getString

public string getString( )

  returns the string of the created table

Returns string

table_string

 

Private Method Details

rtfTable

private void rtfTable( int $cols, int $width, string $align,int $left, int $colorCount, string $bgcolor )

Parameter
int $cols

number of cols
int $witdh

width of the whole table
string $alignment

sets the default alignment
int $left

the distance to the left page border
int $colorCount

internal use, the actual index of the colorTable array
string $bgcolor

the default background color for this table
  Constructor

Returns void

 

getHeader

private void getHeader( )

 

builds the header and returns it as string

Return string $header

 

Private Field Details

$content

private string $content

 

$border

private string $border

 

$align

private string $align

 

$rows

private array $rows

 

$cellString

private string $cellString

 

$cols

private integer $cols

 

$aktCols

private integer $aktCols

 

$left

private string $left

 

$width

private string $width

 

$pageWidth

private integer $pageWidth

 

$colorCount

private integer $colorCount

 

$bgcolor

private boolean $bgcolor

 

$arrAlignment

private array $arrAlignment

 
 
  Classtrees
PHPDoc 1.0alpha