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

Class: HTML_Table_Matrix

Source Location: /HTML_Table_Matrix-1.0.5/Matrix.php

Class Overview

HTML_Table
   |
   --HTML_Table_Matrix

Fills a HTML table with data.


Author(s):

Version:

  • 1.0.2

Methods


Inherited Variables

Inherited Methods


Class Details

[line 49]
Fills a HTML table with data.

Simple usage:

// This is the data to put in the table. $data = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'); $m = &new HTML_Table_Matrix; $m->setData($data); // Pick a filler class. We use the stock left-to-right-top-to-bottom here. $f = &HTML_Table_Matrix_Filler::factory('LRTB'); $m->accept($f); // Make the table 2 rows deep by 5 cols wide $m->setTableSize(2, 5); // Output the table. print $m->toHtml();



[ Top ]


Method Detail

accept   [line 188]

void accept( &$filler)

Accept a Filler

Parameters:

   &$filler   — 

[ Top ]

fillTable   [line 230]

mixed fillTable( )

Fills table with provided data. RL & BT modes are not implemented yet.

This function does the actual laying out of the data into the table. It isn't necessary to call this unless you want to add or change something in the table, as toHtml() calls this automatically if the table has not yet been filled with data.


[ Top ]

setData   [line 125]

void setData( &$data, array $data)

Sets data to fill table with.

Parameters:

array   $data   —  1-dimensional array of matrix data
   &$data   — 

[ Top ]

setFillStart   [line 144]

void setFillStart( int $row, int $col)

Set the row & column to start filling at.

Defaults to (0,0), which is the upper-left corner of the table. Setting this to a larger value will leave other cells empty, e.g. if you want to add a header or other information in the table in addition to the matrix data.


Parameters:

int   $row   —  Row to start filling at
int   $col   —  Column to start filling at

[ Top ]

setTableSize   [line 164]

void setTableSize( [int $rows = 0], [int $cols = 0])

Set the size of the resulting table.

The table will be forced to this size, regardless of whether or not there is enough (or too much) data to fill it up. If the table size (rows * cols) is smaller than the amount of data given to us, only (rows * cols) items are laid out.


Parameters:

int   $rows   —  Number of rows, or zero to auto-size.
int   $cols   —  Number of columns, or zero to auto-size.

[ Top ]

toHtml   [line 277]

string toHtml( )

Returns HTML table. Calls fillTable() if the table has not already been filled.
  • Return: HTML Table
  • See: HTML_Table::toHtml()

[ Top ]

_getTableSize   [line 177]

int _getTableSize( )

Return the total table size (w * h)
  • Return: Table size
  • Access: protected

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:51:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.