Class Table

Table

public class Table


Constructor Summary
Table()
          Initializes the class variables.
 
Method Summary
 unknown AddPassTru(var $content)
          Adds 1 to the row_count count, keeping track of the total number of rows in the table.
 unknown AddRow()
          Adds 1 to the row_count count, keeping track of the total number of rows in the table.
 unknown CompileTable()
          Compile table to HTML.
 unknown GetCurrentCols()
          Returns the current total number of columns in your table
 unknown GetCurrentRow()
          Returns the current row you are working with.
 unknown GetTable()
          Returns the compiled table as string.
 unknown PrintTable()
          Prints out the compiled table.
 unknown printTableArray()
          Allows you to quickly see what is located and where it's located in your table array.
 unknown Set2RowColors(var $odd_colors, var $even_colors, var $start, var $end)
          Set alternating colors.
 unknown SetCellAttribute(var $row, var $col, var $attribute, var $value)
          Allows you to easily set any one attribute of the cell if need be.
 unknown SetCellAttributes(var $row, var $col, var $array)
          Allows you to set multiple attributes for a cell in one method call.
 unknown SetCellBGColor(var $row, var $col, var $bgcolor)
          Set the cells BBGCOLOR setting Allows you to easily set the bgcolor of the cell.
 unknown SetCellClass(var $row, var $col, var $class)
          Allows you to easily set the style of the cell using CSS.
 unknown SetCellColSpan(var $row, var $col, var $colspan)
          Allows you to easily set the colspan attribute of the cell if need be.
 unknown SetCellContent(var $row, var $col, var $content)
          Set the cell's content.
 unknown SetCellRowSpan(var $row, var $col, var $rowspan)
          Allows you to easily set the rowspan attribute of the cell if need be.
 unknown SetCellStyle(var $row, var $col, var $style)
          Allows you to easily set the style of the cell using CSS.
 unknown SetColContent(var $col, var $content)
           
 unknown SetDefaultBGColor(var $bgcolor)
          Sets the default bgcolor for all cells.
 unknown SetDefaultCellAttribute(var $attribute, var $value)
          Sets the default attribute for all cells.
 unknown SetDefaultCellAttributes(var $array)
          Set td default attributes Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for.
 unknown SetDefaultCellContent(var $content)
          Sets the default content for all cells.
 unknown SetDefaultClassForAllCells(var $class)
          Sets the default class for all cells.
 unknown SetDefaultStyle(var $style)
          Sets the default style for all cells.
 unknown SetDefaultTableAttribute(var $array)
          Set table default attributes Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for.
 unknown SetFancyColStyle(var $col, var $attributes)
          Set attributes to particular column.
 unknown SetFancyRowStyle(var $row, var $attributes)
          Set attributes to particular rows.
 unknown SetRowContent(var $row, var $content)
           
 unknown SetTableAttribute(var $key, var $value)
          Set table attribute Sets the table attributes in the same manner as the SetCellAttributes array.
 unknown SetTableAttributes(var $array)
          Set table attributes Sets the table attributes in the same manner as the SetCellAttributes array.
 unknown SetTableClass(var $tableClass)
          Set the Cascading Style Sheet for the table.
 unknown SetTRMouseOverColor(var $overcolor, var $outcolor, var $startingRow)
          Set the TR mouseover color.
 

Constructor Detail

Table

public Table()
Initializes the class variables.
Method Detail

AddRow

public unknown AddRow()
Adds 1 to the row_count count, keeping track of the total number of rows in the table. It returns the current row_count after the addition.
Returns:
int Returns the current number of rows

AddPassTru

public unknown AddPassTru(var $content)
Adds 1 to the row_count count, keeping track of the total number of rows in the table. It returns the current row_count after the addition.
Returns:
int Returns the current number of rows

GetCurrentRow

public unknown GetCurrentRow()
Returns the current row you are working with.
Returns:
int Returns the current number of rows.

GetCurrentCols

public unknown GetCurrentCols()
Returns the current total number of columns in your table
Returns:
int Returns the current number of rows.

SetCellContent

public unknown SetCellContent(var $row,
                              var $col,
                              var $content)
Set the cell's content. Allows you to easily set the content of a cell. The first parameter required is the row the cell is on, followed by the column the cell is in, and then finally, what the content of the cell is.
Parameters:
int - $row
int - $col
string - $content

SetRowContent

public unknown SetRowContent(var $row,
                             var $content)

SetColContent

public unknown SetColContent(var $col,
                             var $content)

SetDefaultCellContent

public unknown SetDefaultCellContent(var $content)
Sets the default content for all cells.
Parameters:
string - $content

SetCellBGColor

public unknown SetCellBGColor(var $row,
                              var $col,
                              var $bgcolor)
Set the cells BBGCOLOR setting Allows you to easily set the bgcolor of the cell. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
string - $bgcolor

SetDefaultBGColor

public unknown SetDefaultBGColor(var $bgcolor)
Sets the default bgcolor for all cells.
Parameters:
string - $bgcolor

SetCellStyle

public unknown SetCellStyle(var $row,
                            var $col,
                            var $style)
Allows you to easily set the style of the cell using CSS. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
string - $style

SetCellClass

public unknown SetCellClass(var $row,
                            var $col,
                            var $class)
Allows you to easily set the style of the cell using CSS. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
string - $class

SetDefaultStyle

public unknown SetDefaultStyle(var $style)
Sets the default style for all cells.
Parameters:
string - $style

SetDefaultClassForAllCells

public unknown SetDefaultClassForAllCells(var $class)
Sets the default class for all cells.
Parameters:
string - $class

SetCellColSpan

public unknown SetCellColSpan(var $row,
                              var $col,
                              var $colspan)
Allows you to easily set the colspan attribute of the cell if need be. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
int - $colspan

SetCellRowSpan

public unknown SetCellRowSpan(var $row,
                              var $col,
                              var $rowspan)
Allows you to easily set the rowspan attribute of the cell if need be. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
int - $rowspan

SetCellAttribute

public unknown SetCellAttribute(var $row,
                                var $col,
                                var $attribute,
                                var $value)
Allows you to easily set any one attribute of the cell if need be. This works the same as the SetCellContent method.
Parameters:
int - $row
int - $col
string - $attribute
string - $value
Returns:
void

SetDefaultCellAttribute

public unknown SetDefaultCellAttribute(var $attribute,
                                       var $value)
Sets the default attribute for all cells.
Parameters:
string - $attribute
string - $value
Returns:
void

SetCellAttributes

public unknown SetCellAttributes(var $row,
                                 var $col,
                                 var $array)
Allows you to set multiple attributes for a cell in one method call. You would call it like this: $attributes = array ( "attribute_name" => "value", "attribute_name_2" => "value"); $table->SetCellAttributes( $row, $col, $attributes );
Parameters:
int - $row
int - $col
array - $array
Returns:
void

SetDefaultCellAttributes

public unknown SetDefaultCellAttributes(var $array)
Set td default attributes Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for. Default attributes can be overriden simply by using one of the aboe methods. If you specifically set an attribute using the 'row', 'col', 'attribute' methods above, they will override the Default Attribute for that one element.
Parameters:
array - $array

SetDefaultTableAttribute

public unknown SetDefaultTableAttribute(var $array)
Set table default attributes Same setup as SetCellAttributes, however, without the row or col parameters (however, the array still works the same way) 'type' is what you are setting default attributes for. Default attributes can be overriden simply by using one of the aboe methods. If you specifically set an attribute using the 'row', 'col', 'attribute' methods above, they will override the Default Attribute for that one element.
Parameters:
array - $array

SetTableAttributes

public unknown SetTableAttributes(var $array)
Set table attributes Sets the table attributes in the same manner as the SetCellAttributes array. The table information is stored in the table array as the first element ($this->table[0]).
Parameters:
array - $array
Returns:
void

SetTableAttribute

public unknown SetTableAttribute(var $key,
                                 var $value)
Set table attribute Sets the table attributes in the same manner as the SetCellAttributes array. The table information is stored in the table array as the first element ($this->table[0]).
Parameters:
array - $array
Returns:
void

SetFancyRowStyle

public unknown SetFancyRowStyle(var $row,
                                var $attributes)
Set attributes to particular rows. You can easily setup attributes for an entire row using this method. You simply send it a row number (or an array of row numbers if more than one) as well as the attributes in an array format (like we do every place else) and all the cells in the row number will be set with those attributes. Styles set in this manner can be overridden by
Parameters:
int - or array $row
array - $attributes

SetFancyColStyle

public unknown SetFancyColStyle(var $col,
                                var $attributes)
Set attributes to particular column. This works the same way as the SetFancyRowStyle method, except that this method works on arrays. This method will override SetFancyRowStyle styles which are set.
Parameters:
int - || array $row
array - $attributes

Set2RowColors

public unknown Set2RowColors(var $odd_colors,
                             var $even_colors,
                             var $start,
                             var $end)
Set alternating colors. You simply put in two HTML compatible colors, like * it will creat alternating color rows.
Parameters:
string - $odd_colors The odd numbered rows bgcolor value
string - $even_colors The even numbered rows bgcolor value
int - $start What row to start outputting the alternating colors on. Defaults to 1 (the first row).
int - $end What row to stop outputting the alternating colors on. Defaults to the GetCurrentRow() value
$start - Default Value: 1
$end - Default Value: false

SetTableClass

public unknown SetTableClass(var $tableClass)
Set the Cascading Style Sheet for the table.
Returns:
void

SetTRMouseOverColor

public unknown SetTRMouseOverColor(var $overcolor,
                                   var $outcolor,
                                   var $startingRow)
Set the TR mouseover color.
Returns:
void

CompileTable

public unknown CompileTable()
Compile table to HTML. Turns the table array into an HTML table. This must be called before a table can be printed out.
Returns:
string Returns a string of the table in HTML Format

PrintTable

public unknown PrintTable()
Prints out the compiled table.

GetTable

public unknown GetTable()
Returns the compiled table as string.

printTableArray

public unknown printTableArray()
Allows you to quickly see what is located and where it's located in your table array. Used for debugging purposes.