Documentation is available at xhtml_table.php
- <?
- /* These are a set of classes used to create tables. One of the most powerful
- * features of HTMLClass*/
- /* Abstract cell*/
- class cell extends xml_element
- {
- var $cell_content;
- function cell($content="",$attributes=array())
- {
- $this->xml_element("td",$attributes);
- $this->cell_content=&$this->add_child($content);
- }
- function &cell_content()
- {
- return $this->cell_content;
- }
- }
- /* Header Cell */
- class hcell extends cell
- {
- function hcell($content="",$attributes=array())
- {
- $this->cell($content,$attributes);
- $this->tag="th";
- }
- }
- /* Cell are chained into rows*/
- class row extends xml_element
- {
- function row($attributes=array())
- {
- $this->xml_element("tr",$attributes);
- }
- function &add_col($content="",$attributes=array())
- {
- $this->lastcell=&$this->add_child(new cell ($content,$attributes));
- return $this->lastcell;
- }
- }
- /* Rows are formed into table*/
- class table extends xml_element
- {
- var $caption;
- function table($caption="",$attributes=array())
- {
- $this->xml_element("table",$attributes);
- if ($caption!="") $this->caption=&$this->add_child(new caption($caption));
- $this->lastrow=-1;
- }
- function &new_row($attributes=array())
- {
- $this->lastrow=&$this->add_child(new row ($attributes));
- return $this->lastrow;
- }
- function &add_row($row)
- {
- $this->lastrow=&$this->add_child($row);
- return $this->lastrow;
- }
- function &add_col($content="",$attributes=array(),$id=-1)
- {
- if ($id==-1) $id=&$this->lastrow;
- if ($id==-1) $id=&$this->new_row();
- return $id->add_col($content,$attributes);
- }
- function &get_cell($x=-1,$y=-1)
- {
- if ($x==-1) $x=$this->lastrow;
- if ($y==-1) {
- $y=$this->get_child($x);
- $y=$y->lastcell;
- }
- $temp= $this->get_child($x);
- return $temp->get_child($y);
- }
- function &get_row($x)
- {
- return $this->get_child($x);
- }
- }
Documentation generated on Tue, 24 May 2005 03:59:28 -0400 by phpDocumentor 1.3.0RC3