BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/html/table/Bs_HtmlTable.class.php
BlueShoes Application Framework - html/table

Bs_HtmlTable

Bs_Object
   |
  +-- Bs_HtmlTable

**********************************************************************

 

private class Bs_HtmlTable extends Bs_Object

**********************************************************************
HtmlTable classCan manipulate content, attributes and style and then render the datato a nicely formed HTML table.Following functions are coveredo) Data manipulationInit- Init with a 2D arraySet- Push in a row or column of data (as value or 1D array)- Set (overwrite) a row, column or area of data.Get data streams (all by *reference* !) of- a row, column or area of data.o) HidingHide rows, columns or areaso) SpanningSpan rows, columns or areaso) Attribute and STYLE setting:It's possible to set or merge styles(see *1) and attributes(see *2) to- the specific HTML-table tag : TABLE and TR- a random table cell (by setting the TD-tag OR using the <SPAN STYLE=...> ... </SPAN> tag)- all, row, column or area of cells (by setting the TD-tag OR using the <SPAN STYLE=...> ... </SPAN> tag)Support to set relative areas like- Center, top row, zebra, ...See Bs_HtmlTableWindrose.class.phpo) Table cascadingThe content of a cell can be an other Bs_HtmlTable-object itself. It is then rendered ascascading table.NOTE *1) and *2)I'm distinguishing between HTML-attributes and STYLE although STYLE is actuallyalso a HTML-attribute that holds another set of attributes (which gave me a name space headache ;-) )So fuctions end often with 'Attr' or 'Style' like setTableAttr() or setTableStyle()One setting the STYLE attributes, the other the HTML-tag attributes.NOTE: The order of paramters is ROW, then COLUMN. Positions start with 0, 0.This is important to know when you want to define an area in thetable. Area is defined by a point (row/col) and amount(!) (x-rows/y-cols)It's like a normal x/y-coordonat system turned by +90°E.g. the area in the folling example would be defined as getArea(1,3,3,4)(0/0)|---+--3---7-> col1 x <--- at (1/3) (row/col)|4 x <--- at (4/7) (row/col)|rowexample: (to get you started)$data = array(array('apfel', 'banane', 'pfirsich'),array('stuhl', 'tisch', 'bank'));$tbl =& new Bs_HtmlTable($data);echo &$tbl->renderTable();//huh, that was easy, right? only because it offers *alot* doesn't meen it is//complicated.DISCLAIMER This code is provided to you, "as is". Best efforts have been made tomaintain it, but the authors are not responsible for the results of any defectsthat may be found to exist, or any lost profits or other consequential damagesthat may result from such defects. You should not assume that this code iserror-free or that it will be suitable for the particular purpose that you havein mind when using it.

Authors
Version4.0.$id$
Copyrightblueshoes.org

 

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

Bs_HtmlTable(string $matrix)

**********************************************************************
void

clear()

**********************************************************************
int

getNumRows()

returns the number of rows (including title rows etc, just everything).
int

getNumCols()

returns the number of cols (including title cols etc, just everything).
void

initByMatrix(mixed $value)

**********************************************************************
integer

pushRow(array $value, [ integer $rowPos ])

**********************************************************************
integer

pushCol(array $value, [ integer $colPos ])

**********************************************************************
void

setRow(integer $rowPos, mixed $value, [ integer $offset, string $amount ])

**********************************************************************
void

setCol(integer $colPos, mixed $value, [ integer $offset, string $amount ])

**********************************************************************
void

setArea(integer $rowPos, integer $colPos, mixed $value, [ string $x, string $y ])

**********************************************************************
array

&getRow(integer $rowPos, [ string $what ])

**********************************************************************
array

&getCol(integer $colPos, [ string $what ])

**********************************************************************
array

&getArea([ integer $rowPos, integer $colPos, string $x, string $y, string $what ])

**********************************************************************
array

&getAreaStream(integer $rowPos, integer $colPos, string $x, string $y, string $what)

**********************************************************************
void

hideRow(integer $rowPos, [ integer $offset, string $amount ])

**********************************************************************
void

hideCol(integer $colPos, [ integer $offset, string $amount ])

**********************************************************************
void

hideArea(integer $rowPos, integer $colPos, [ string $x, string $y ])

**********************************************************************
void

spanRow(integer $rowPos, [ integer $offset, string $amount ])

**********************************************************************
void

spanCol(integer $colPos, [ integer $offset, string $amount ])

**********************************************************************
void

spanArea(integer $rowPos, integer $colPos, [ string $x, string $y ])

**********************************************************************
void

setTableAttr(mixed $newAttr)

**********************************************************************
void

setTrAttr(integer $rowPos, mixed $newAttr)

**********************************************************************
void

setTdAttr(integer $rowPos, integer $colPos, mixed $newAttr)

**********************************************************************
void

setGlobalTrAttr(mixed $newAttr)

**********************************************************************
void

setGlobalTdAttr(mixed $newAttr)

**********************************************************************
void

setRowAttr(integer $rowPos, mixed $newAttr, [ integer $offset, string $amount ])

**********************************************************************
void

setColAttr(integer $colPos, mixed $newAttr, [ integer $offset, string $amount ])

**********************************************************************
void

setAreaAttr(integer $rowPos, integer $colPos, array $newAttr, [ string $x, string $y ])

**********************************************************************
void

setTableStyle(mixed $newStyle)

**********************************************************************
void

setTrStyle(integer $rowPos, mixed $newStyle)

**********************************************************************
void

setTdStyle(integer $rowPos, integer $colPos, mixed $newStyle)

**********************************************************************
void

setGlobalTrStyle(mixed $newStyle)

**********************************************************************
void

setGlobalTdStyle(mixed $newStyle)

**********************************************************************
void

setRowStyle(integer $rowPos, mixed $newStyle, [ integer $offset, string $amount ])

**********************************************************************
void

setColStyle(integer $colPos, mixed $newStyle, [ integer $offset, string $amount ])

**********************************************************************
void

setAreaStyle(integer $rowPos, integer $colPos, mixed $newStyle, [ string $x, string $y ])

**********************************************************************
void

setWindroseStyle(object A $htmlWindroseObj)

**********************************************************************
string

&renderTable([ string $useClassID, integer $indent ])

**********************************************************************
void

flipData()

**********************************************************************

Private Method Summary

void

&toHtml()

**********************************************************************
void

_trimArea([ integer $rowPos, integer $colPos, string $x, string $y ])

**********************************************************************
array

&_hashKeysToLower(array &$hashArray)

**********************************************************************
string

&_renderTag( $tag, &$attrHash, &$styleHash)

**********************************************************************
void

_xRay()

**********************************************************************

Public Field Summary

array

$cell

Cell: You may modify this var directly. It stands for the HTML table cell and has

Private Field Summary

integer

$_rowSize

The current amount of rows.
integer

$_colSize

The current amount of columns.
array

$_tableAttr

Variables holding the attributes for the tags TABLE and TR (TD attr. are in the cell variable; see $this->cell)
array

$_tableStyle

Variables holding the STYLE-attribute for TABLE and TR (TD style attr. are in the cell variable; see $this->cell)
array

$_trAttr

array

$_globalTrAttr

array

$_globalTdAttr

array

$_trStyle

array

$_globalTrStyle

array

$_globalTdStyle

string

$htmlTableWindrose

Private Constant Summary

BS_HTMLTABLE_VERSION >>4.0.$x$<< Warning: documentation is missing.

Public Method Details

Bs_HtmlTable

public void Bs_HtmlTable( string $matrix )

  **********************************************************************
Constructor

Parameter
string $matrix
Warning: documentation is missing.
Returns void


clear

public void clear( )

  **********************************************************************
Reset and clear the tableThe only thing that remains is the windrose.

Returns void


getNumRows

public int getNumRows( )

  returns the number of rows (including title rows etc, just everything).

Returns int

See Also getNumCols(), $_rowSize

getNumCols

public int getNumCols( )

  returns the number of cols (including title cols etc, just everything).

Returns int

See Also getNumRows(), $_colSize

initByMatrix

public void initByMatrix( mixed $value )

  **********************************************************************
Init the content of the HtmlTable object.Only content is overwritten; attr.-, style-, hidding-, spanning-info etc. are preserved.If $value is not an array a 1 x 1 table is created.If $value is an 1-D array a 1 x m table is created. Table with 1-row/m-cols.If $value is an 2-D array a n x m table is created. Table with n-row/m-cols.n = size of array / m = size of inner arrayHash arrays and normal arrays are accepted. Also a 2-D array may have longershorter row-length. The table will take the longest row as its row size.NOTE: You may pass data by reference. Any change on that data will effectthe table content as well.NOTE: The content of a cell can be an other Bs_HtmlTable-object itself. Itis then also rendered as cascading table.

Parameter
mixed $value
a value, 1-D or 2-D array of data (HTML table content).
Returns void


pushRow

public integer pushRow( array $value, [ integer $rowPos ] )

  **********************************************************************
Inserts a ROW (any array of data) at postion $rowPos by pushing the other rows down.If no position is given or if the position is larger then the max rows,the array will append to the last row position.NOTE: If passed array is to short (meaning: there are more cols then array elements)the array will be blown up with NULL values.If it's to long, it will be cut.

Parameter
array $value
a value or 1-D array of HTML table content.
integer $rowPos = >>-1<<
(opt) row position to push in the data. Default: at the end.
Returns integer

The position the row was inserted.


pushCol

public integer pushCol( array $value, [ integer $colPos ] )

  **********************************************************************
Inserts a COL (any array of data) at postion $colPos by pushing the other cols to right.If no position is given or if the position is larger then the max cols,the array will append to the last col position.NOTE: If passed array is to short (meaning: there more cols then array elements)the array will be blown up with NULL values.It it's to long, it will be cut.

Parameter
array $value
a value or 1-D array of HTML table content.
integer $colPos = >>-1<<
(opt) row position to push in the data. Default: at the end.
Returns integer

The position the col was inserted.


setRow

public void setRow( integer $rowPos, mixed $value, [ integer $offset, string $amount ] )

  **********************************************************************
Fill a table row with content given by a value or any 1-D array.Any data passing the table limits is truncated.

Parameter
integer $rowPos
the abs. row number starting with 0
mixed $value
or 1-D array of content
integer $offset = >>0<<
(opt) where to start inserting (Default 0)
string $amount = >>''<<
eter $amount (opt) of cells to set (Default to table end OR in case of array: array-length)
Returns void


setCol

public void setCol( integer $colPos, mixed $value, [ integer $offset, string $amount ] )

  **********************************************************************
Fill a table col with content given by a value or a 1-D array.Any data passing the table limits is truncated.

Parameter
integer $colPos
the abs. col number starting with 0
mixed $value
or 1-D array of content
integer $offset = >>0<<
(opt) where to start inserting (Default 0)
string $amount = >>''<<
eter $amount (opt) of cells to set (Default to table end OR in case of array: array-length)
Returns void


setArea

public void setArea( integer $rowPos, integer $colPos, mixed $value, [ string $x, string $y ] )

  **********************************************************************
Fill a table area with a value, a 1-D array[row] or 2-D array[row][col].Begining at the position given be the coordinats params. Staring at (0/0).Any data passing the table limits is truncated.

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
mixed $value
value, a 1-D array[row] or 2-D array[row][col] of HTML table content.
string $x = >>''<<
(opt) amount of rows to set (Default to table end)
string $y = >>''<<
(opt) amount of cols to set (Default to table end)
Returns void


&getRow

public array &getRow( integer $rowPos, [ string $what ] )

  **********************************************************************
Gets a 1-D array stream by *reference* of a row defined by the $rowPos.With the $what param it is possible to pick a cell part e.g. 'data'

Parameter
integer $rowPos
the abs. row number starting with 0
string $what = >>NULL<<
(opt) (Default a whole cell)
Returns array

stream by *reference* of 'wath'. Or empty array if off limit.


&getCol

public array &getCol( integer $colPos, [ string $what ] )

  **********************************************************************
Gets a 1-D array stream by *reference* of a column defined by the $colPos.With the $what param it is possible to pick a cell part e.g. 'data'

Parameter
integer $colPos
the abs. col number starting with 0
string $what = >>NULL<<
(opt) (Default a whole cell)
Returns array

stream by *reference* of 'wath'. Or empty array if off limit.


&getArea

public array &getArea( [ integer $rowPos, integer $colPos, string $x, string $y, string $what ] )

  **********************************************************************
Gets a 2-D array clip by *reference* of all the cells defined by the area.With the $what param it is possible to pick a cell part e.g. 'data'or 'attr' instead of the whole cell.

Parameter
integer $rowPos = >>0<<
(opt) Start of get row (Default 0)
integer $colPos = >>0<<
(opt) Start of get col (Default 0)
string $x = >>''<<
(opt) amount of row (Default ALL)
string $y = >>''<<
(opt) amount of col (Default ALL)
string $what = >>NULL<<
(opt) (Default a whole cell)
Returns array

clip by *reference* of 'wath'. Or empty array if off limit.


&getAreaStream

public array &getAreaStream( integer $rowPos, integer $colPos, string $x, string $y, string $what )

  **********************************************************************
Same as $this->getArea()But gets a 1-D array stream by *reference* of all the cells defined bythe area. Handy to loop through the table data to change it.

Parameter
integer $rowPos
Warning: documentation is missing.
integer $colPos
Warning: documentation is missing.
string $x
Warning: documentation is missing.
string $y
Warning: documentation is missing.
string $what
Warning: documentation is missing.
Returns array

stream by *reference* of 'wath'. Or empty array if off limit.


hideRow

public void hideRow( integer $rowPos, [ integer $offset, string $amount ] )

  **********************************************************************
Hides (skips) the content of a row when rendering the table

Parameter
integer $rowPos
the abs. row number starting with 0
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
of cells (Default to table end)
Returns void


hideCol

public void hideCol( integer $colPos, [ integer $offset, string $amount ] )

  **********************************************************************
Hides (skips) the content of a column when rendering the table

Parameter
integer $colPos
the abs. col number starting with 0
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
eter $amount of cells (Default to table end)
Returns void


hideArea

public void hideArea( integer $rowPos, integer $colPos, [ string $x, string $y ] )

  **********************************************************************
Hides (skips) the content of an area when rendering the table

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
string $x = >>''<<
(opt) $x amount of rows
string $y = >>''<<
(opt) $y amount of cols
Returns void


spanRow

public void spanRow( integer $rowPos, [ integer $offset, string $amount ] )

  **********************************************************************
Row spanning

Parameter
integer $rowPos
the abs. row number starting with 0
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
eter $amount (opt) to span (Default to table end)
Returns void


spanCol

public void spanCol( integer $colPos, [ integer $offset, string $amount ] )

  **********************************************************************
column spanning

Parameter
integer $colPos
the abs. col number starting with 0
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
eter $amount (opt) to span (Default to table end)
Returns void


spanArea

public void spanArea( integer $rowPos, integer $colPos, [ string $x, string $y ] )

  **********************************************************************
Area spanning. Returns FALSE if a span overlapping is detected.

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
string $x = >>''<<
(opt) amount of row span (Default to table end)
string $y = >>''<<
(opt) amount of col span (Default to table end)
Returns void


setTableAttr

public void setTableAttr( mixed $newAttr )

  **********************************************************************
Sets any TABLE attributes using name/value pair or hash array.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set.If value = NULL only a name will be placed.The hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
Returns void


setTrAttr

public void setTrAttr( integer $rowPos, mixed $newAttr )

  **********************************************************************
Sets any TR-tag attribute. (The HTML Table Row tag)Pass a hash array containing the name(s) and value(s) pair(s) you wish to set.If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more performant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
integer $rowPos
the abs. row number starting with 0
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
Returns void


setTdAttr

public void setTdAttr( integer $rowPos, integer $colPos, mixed $newAttr )

  **********************************************************************
Sets any TD attribute (The HTML Table Data tag)Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
Returns void


setGlobalTrAttr

public void setGlobalTrAttr( mixed $newAttr )

  **********************************************************************
Sets all TR attributes befor any other attr. are set. Following TRattributes are then merged on top.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
Returns void


setGlobalTdAttr

public void setGlobalTdAttr( mixed $newAttr )

  **********************************************************************
Sets all TD attributes befor any other attr. are set. Following TDattributes are then merged on top.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
Returns void


setRowAttr

public void setRowAttr( integer $rowPos, mixed $newAttr, [ integer $offset, string $amount ] )

  **********************************************************************
Sets any attributes to one row by setting each TD tag.NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
integer $rowPos
the abs. row number starting with 0
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
of cells (Default to table end)
Returns void


setColAttr

public void setColAttr( integer $colPos, mixed $newAttr, [ integer $offset, string $amount ] )

  **********************************************************************
Sets any STYLE attributes to one column by setting each TD tag.NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
integer $colPos
the abs. col number starting with 0
mixed $newAttr
string OR hash array of attribute(s) e.g. 'width="50px ...' OR array('width'=>'50px', ...)
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
eter $amount of cells (Default to table end)
Returns void


setAreaAttr

public void setAreaAttr( integer $rowPos, integer $colPos, array $newAttr, [ string $x, string $y ] )

  **********************************************************************
Sets any TD attributes to an area of cells by setting each TD tag.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name="value" name="value"'

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
array $newAttr
hash array of attribute(s) e.g. array('width'=>'50px', ...)
string $x = >>''<<
(opt) amount of row to set (Default to table end)
string $y = >>''<<
(opt) amount of col to set (Default to table end)
Returns void


setTableStyle

public void setTableStyle( mixed $newStyle )

  **********************************************************************
Sets the STYLE-attr in the TABLE-tag using name/value pair or hash array.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placed. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
Returns void


setTrStyle

public void setTrStyle( integer $rowPos, mixed $newStyle )

  **********************************************************************
Sets the STYLE-attr in any TR-tagPass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
integer $rowPos
the abs. row number starting with 0
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
Returns void


setTdStyle

public void setTdStyle( integer $rowPos, integer $colPos, mixed $newStyle )

  **********************************************************************
Sets the STYLE-attr in any TD-tagPass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
Returns void


setGlobalTrStyle

public void setGlobalTrStyle( mixed $newStyle )

  **********************************************************************
Sets the STYLE-attr to all TR attributes befor any other attr. are set. Following TRstyles are then merged on top.Pass a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
Returns void


setGlobalTdStyle

public void setGlobalTdStyle( mixed $newStyle )

  **********************************************************************
Sets the STYLE-attr to all TD attributes befor any other attr. are set. Following TDstyles are then merged on top.Pass a style-string OR a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
Returns void


setRowStyle

public void setRowStyle( integer $rowPos, mixed $newStyle, [ integer $offset, string $amount ] )

  **********************************************************************
Sets any STYLE attributes to one row by setting each TD tag.NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
integer $rowPos
the abs. row number starting with 0
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
of cells (Default to table end)
Returns void


setColStyle

public void setColStyle( integer $colPos, mixed $newStyle, [ integer $offset, string $amount ] )

  **********************************************************************
Sets any STYLE attributes to one col by setting each TD tag.NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
integer $colPos
the abs. col number starting with 0
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
integer $offset = >>0<<
(opt) number to skip (Default 0)
string $amount = >>''<<
eter $amount of cells (Default to table end)
Returns void


setAreaStyle

public void setAreaStyle( integer $rowPos, integer $colPos, mixed $newStyle, [ string $x, string $y ] )

  **********************************************************************
Sets any STYLE attributes to an area of cells by setting each TD tag.Pass a style-string OR a hash array containing the name(s) and value(s) pair(s) you wish to set. If value = NULL only name will be placedThe hash array must have the form: array(name=>value, name=>value, name=>NULL, ...).NOTE: Using hash array is more perfomant.If you use a string, then use the right syntax! 'name:value; name:value;'

Parameter
integer $rowPos
the abs. row number starting with 0
integer $colPos
the abs. col number starting with 0
mixed $newStyle
string OR hash array of attribute(s) e.g. 'font:arial;...' OR array('font'=>'arial', ...)
string $x = >>''<<
(opt) amount of row to set (Default to table end)
string $y = >>''<<
(opt) amount of col to set (Default to table end)
Returns void


setWindroseStyle

public void setWindroseStyle( object A $htmlWindroseObj )

  **********************************************************************
Set a windrose objectThe windrose object has knowledge where to set a style at a RELATIVE positionof a HTML table such as North, Center, Zebra, ...It is recommended to pass the windrose object by reference. All changes to windrosewill then be reflected during the Html table rendering

Parameter
object A $htmlWindroseObj
Bs_HtmlTableWindrose object. RECOMMENDATION: pass by reference.
Returns void


&renderTable

public string &renderTable( [ string $useClassID, integer $indent ] )

  **********************************************************************
Renders the HTML tableHere we put all the data together.1) Global attrs and global styles are set first.2*)If windrose is set: windrose-attrs and -styles are set.3) Finally the set attrs and styles are merged on top.*)Special case in step 2) if $useClassID is TRUE. Instead of setting the stylewe add the CLASS-tag and style ID. This makes sens when you plan to use CSS.See Bs_HtmlTableWindrose->getCssBlock().

Parameter
string $useClassID = >>FALSE,<<
see above
integer $indent = >>2<<
amount of space to indent at beginning
Returns string

The HTML output.


flipData

public void flipData( )

  **********************************************************************
Flips a table data only by setting rows to cols and cols to rows

Returns void


Private Method Details

&toHtml

private void &toHtml( )

  **********************************************************************
Renders the HTML table

Returns void


_trimArea

private void _trimArea( [ integer $rowPos, integer $colPos, string $x, string $y ] )

  **********************************************************************
Many functions of HtmlTable use areas defined by 4 parametersStart point ($rowPos/$colPos) and amount of cells ($x/$y) If thestart point is out of range (0/0) is returned.If the amount to large it's trancated to the max size; depending on pointand table size.

Parameter
integer $rowPos = >>0<<
integer $colPos = >>0<<
string $x = >>''<<
(opt) $x amount of rows
string $y = >>''<<
(opt) $y amount of cols
Returns void


&_hashKeysToLower

private array &_hashKeysToLower( array &$hashArray )

  **********************************************************************
Transform all keys of a hash array to lower case

Parameter
array &$hashArray
Returns array

with all keys to lower case


&_renderTag

private string &_renderTag( $tag, &$attrHash, &$styleHash )

  **********************************************************************

Parameter
$tag
Warning: documentation is missing.
&$attrHash
Warning: documentation is missing.
&$styleHash
Warning: documentation is missing.
Returns string


_xRay

private void _xRay( )

  **********************************************************************
A output format used for debugging

Returns void


Public Field Details

$cell

public array $cell

>>array()<<

Cell: You may modify this var directly. It stands for the HTML table cell and has
the format$cell[$row][$col]['data'] : The cell content (usualy a string OR a Bs_HtmlTable.class object)$cell[$row][$col]['attr'] : A hash array holding the 'cell' attr. used in the <TD> tag. See setTdAttr()" " " ['style'] : A hash array holding the 'cell' style used in the <TD STYLE= > tag. See setTdStyle()['hidden']: If TRUE don't show the content when rendering the table.['span_start']: If TRUE this cell is the top left cell of a spaned area['spaned'] : If TRUE this cell belongs to a spaned area. Not shown when rendering the table.


Private Field Details

$_rowSize

private integer $_rowSize

>><<

The current amount of rows.

See Also getNumRows(), $_colSize

$_colSize

private integer $_colSize

>><<

The current amount of columns.

See Also getNumCols(), $_rowSize

$_tableAttr

private array $_tableAttr

>>array()<<

Variables holding the attributes for the tags TABLE and TR (TD attr. are in the cell variable; see $this->cell)


$_tableStyle

private array $_tableStyle

>>array()<<

Variables holding the STYLE-attribute for TABLE and TR (TD style attr. are in the cell variable; see $this->cell)


$_trAttr

private array $_trAttr

>>array()<<



$_globalTrAttr

private array $_globalTrAttr

>>array()<<



$_globalTdAttr

private array $_globalTdAttr

>>array()<<



$_trStyle

private array $_trStyle

>>array()<<



$_globalTrStyle

private array $_globalTrStyle

>>array()<<



$_globalTdStyle

private array $_globalTdStyle

>>array()<<



$htmlTableWindrose

private string $htmlTableWindrose

>>NULL<<



Private Constant Details

BS_HTMLTABLE_VERSION

define( BS_HTMLTABLE_VERSION, >>4.0.$x$<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta