HTML_Table
[ class tree: HTML_Table ] [ index: HTML_Table ] [ all elements ]

Class: HTML_Table_Storage

Source Location: /HTML_Table-1.8.3/Table/Storage.php

Class Overview

HTML_Common
   |
   --HTML_Table_Storage

Storage class for HTML::Table data


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2006 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 70]
Storage class for HTML::Table data

This class stores data for tables built with HTML_Table. When having more than one instance, it can be used for grouping the table into the parts <thead>...</thead>, <tfoot>...</tfoot> and <tbody>...</tbody>.



[ Top ]


Method Detail

HTML_Table_Storage (Constructor)   [line 129]

HTML_Table_Storage HTML_Table_Storage( [int $tabOffset = 0], [bool $useTGroups = false])

Class constructor
  • Access: public

Parameters:

int   $tabOffset   — 
bool   $useTGroups   —  Whether to use <thead>, <tfoot> and <tbody> or not

[ Top ]

addCol   [line 619]

int addCol( [array $contents = null], [mixed $attributes = null], [string $type = 'td'])

Adds a table column and returns the column identifier
  • Access: public

Parameters:

array   $contents   —  (optional) Must be a indexed array of valid cell contents
mixed   $attributes   —  (optional) Associative array or string of table row attributes
string   $type   —  (optional) Cell type either 'th' or 'td'

[ Top ]

addRow   [line 475]

int addRow( [array $contents = null], [mixed $attributes = null], [string $type = 'td'], [bool $inTR = false])

Adds a table row and returns the row identifier
  • Access: public

Parameters:

array   $contents   —  (optional) Must be a indexed array of valid cell contents
mixed   $attributes   —  (optional) Associative array or string of table row attributes. This can also be an array of attributes, in which case the attributes will be repeated in a loop.
string   $type   —  (optional) Cell type either 'th' or 'td'
bool   $inTR   —  false if attributes are to be applied in TD tags; true if attributes are to be applied in TR tag

[ Top ]

altRowAttributes   [line 596]

void altRowAttributes( int $start, mixed $attributes1, mixed $attributes2, [bool $inTR = false], [int $firstAttributes = 1])

Alternates the row attributes starting at $start
  • Access: public

Parameters:

int   $start   —  Row index of row in which alternating begins
mixed   $attributes1   —  Associative array or string of table row attributes
mixed   $attributes2   —  Associative array or string of table row attributes
bool   $inTR   —  false if attributes are to be applied in TD tags; true if attributes are to be applied in TR tag
int   $firstAttributes   —  (optional) Which attributes should be applied to the first row, 1 or 2.

[ Top ]

getAutoFill   [line 170]

mixed getAutoFill( )

Returns the autoFill value
  • Access: public

[ Top ]

getAutoGrow   [line 190]

mixed getAutoGrow( )

Returns the autoGrow value
  • Access: public

[ Top ]

getCellAttributes   [line 337]

array getCellAttributes( int $row, int $col)

Returns the attributes for a given cell
  • Access: public

Parameters:

int   $row   —  Row index
int   $col   —  Column index

[ Top ]

getCellContents   [line 427]

mixed getCellContents( int $row, int $col)

Returns the cell contents for an existing cell
  • Access: public

Parameters:

int   $row   —  Row index
int   $col   —  Column index

[ Top ]

getColCount   [line 235]

int getColCount( [int $row = null])

Gets the number of columns in the table

If a row index is specified, the count will not take the spanned cells into account in the return value.

  • Access: public

Parameters:

int   $row   —  Row index to serve for cols count

[ Top ]

getRowAttributes   [line 573]

array getRowAttributes( int $row)

Returns the attributes for a given row as contained in the TR tag
  • Access: public

Parameters:

int   $row   —  Row index

[ Top ]

getRowCount   [line 220]

int getRowCount( )

Returns the number of rows in the table
  • Access: public

[ Top ]

getUseTGroups   [line 150]

boolean getUseTGroups( )

Returns the useTGroups value
  • Access: public

[ Top ]

setAllAttributes   [line 688]

void setAllAttributes( [mixed $attributes = null])

Sets the attributes for all cells
  • Access: public

Parameters:

mixed   $attributes   —  (optional) Associative array or string of table row attributes

[ Top ]

setAutoFill   [line 160]

void setAutoFill( mixed $fill)

Sets the autoFill value
  • Access: public

Parameters:

mixed   $fill   — 

[ Top ]

setAutoGrow   [line 180]

void setAutoGrow( $grow, bool $fill)

Sets the autoGrow value
  • Access: public

Parameters:

bool   $fill   — 
   $grow   — 

[ Top ]

setCellAttributes   [line 289]

void setCellAttributes( int $row, int $col, mixed $attributes)

Sets the cell attributes for an existing cell.

If the given indices do not exist and autoGrow is true then the given row and/or col is automatically added. If autoGrow is false then an error is returned.

  • Throws: PEAR_Error
  • Access: public

Parameters:

int   $row   —  Row index
int   $col   —  Column index
mixed   $attributes   —  Associative array or string of table row attributes

[ Top ]

setCellContents   [line 368]

void setCellContents( int $row, int $col, mixed $contents, [string $type = 'TD'])

Sets the cell contents for an existing cell

If the given indices do not exist and autoGrow is true then the given row and/or col is automatically added. If autoGrow is false then an error is returned.

  • Throws: PEAR_Error
  • Access: public

Parameters:

int   $row   —  Row index
int   $col   —  Column index
mixed   $contents   —  May contain html or any object with a toHTML() method; if it is an array (with strings and/or objects), $col will be used as start offset and the array elements will be set to this and the following columns in $row
string   $type   —  (optional) Cell type either 'TH' or 'TD'

[ Top ]

setColAttributes   [line 649]

void setColAttributes( int $col, [mixed $attributes = null])

Sets the column attributes for an existing column
  • Access: public

Parameters:

int   $col   —  Column index
mixed   $attributes   —  (optional) Associative array or string of table row attributes

[ Top ]

setColCount   [line 210]

void setColCount( int $cols)

Sets the number of columns in the table
  • Access: public

Parameters:

int   $cols   — 

[ Top ]

setColType   [line 269]

void setColType( int $col, string $type)

Sets a columns type 'TH' or 'TD'
  • Access: public

Parameters:

int   $col   —  Column index
string   $type   —  'TH' or 'TD'

[ Top ]

setHeaderContents   [line 450]

void setHeaderContents( int $row, int $col, mixed $contents, [mixed $attributes = null])

Sets the contents of a header cell
  • Access: public

Parameters:

int   $row   — 
int   $col   — 
mixed   $contents   — 
mixed   $attributes   —  Associative array or string of table row attributes

[ Top ]

setRowAttributes   [line 512]

void setRowAttributes( int $row, mixed $attributes, [bool $inTR = false])

Sets the row attributes for an existing row
  • Throws: PEAR_Error
  • Access: public

Parameters:

int   $row   —  Row index
mixed   $attributes   —  Associative array or string of table row attributes. This can also be an array of attributes, in which case the attributes will be repeated in a loop.
bool   $inTR   —  false if attributes are to be applied in TD tags; true if attributes are to be applied in TR tag

[ Top ]

setRowCount   [line 200]

void setRowCount( int $rows)

Sets the number of rows in the table
  • Access: public

Parameters:

int   $rows   — 

[ Top ]

setRowType   [line 256]

void setRowType( int $row, string $type)

Sets a rows type 'TH' or 'TD'
  • Access: public

Parameters:

int   $row   —  Row index
string   $type   —  'TH' or 'TD'

[ Top ]

setUseTGroups   [line 140]

void setUseTGroups( boolean $useTGroups)

Sets the useTGroups value
  • Access: public

Parameters:

boolean   $useTGroups   — 

[ Top ]

toHtml   [line 713]

string toHtml( [ $tabs = null], [ $tab = null])

Returns the table rows as HTML
  • Access: public

Parameters:

   $tabs   — 
   $tab   — 

[ Top ]

updateAllAttributes   [line 701]

void updateAllAttributes( [mixed $attributes = null])

Updates the attributes for all cells
  • Access: public

Parameters:

mixed   $attributes   —  (optional) Associative array or string of table row attributes

[ Top ]

updateCellAttributes   [line 314]

void updateCellAttributes( int $row, int $col, mixed $attributes)

Updates the cell attributes passed but leaves other existing attributes

intact

  • Access: public

Parameters:

int   $row   —  Row index
int   $col   —  Column index
mixed   $attributes   —  Associative array or string of table row attributes

[ Top ]

updateColAttributes   [line 669]

void updateColAttributes( int $col, [mixed $attributes = null])

Updates the column attributes for an existing column
  • Access: public

Parameters:

int   $col   —  Column index
mixed   $attributes   —  (optional) Associative array or string of table row attributes

[ Top ]

updateRowAttributes   [line 545]

void updateRowAttributes( int $row, [mixed $attributes = null], [bool $inTR = false])

Updates the row attributes for an existing row
  • Throws: PEAR_Error
  • Access: public

Parameters:

int   $row   —  Row index
mixed   $attributes   —  Associative array or string of table row attributes
bool   $inTR   —  false if attributes are to be applied in TD tags; true if attributes are to be applied in TR tag

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:36:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.