object. This can have a parent or not: if it does, * then it will be painted as a child, otherwise it will act as a root. * * @author Blue Static * @copyright Copyright (c)2002 - [#]year[#], Blue Static * @version $Revision$ * @package ISSO * */ class BSPrinterRootElementTable extends BSPrinterRootElement { /** * Maximum number of columns * @var integer */ private $colspan = 0; // ################################################################### /** * Adds a table row into the child list * * @param BSPrinterTableElement Table element */ public function addChild(BSPrinterElement $tr) { $this->children[] = $tr; } // ################################################################### /** * Calculates the number of columns to display based on the colspan * of children elements */ private function _calculateColumnCount() { foreach ($this->children AS $child) { if ($child->numberOfColumns() > $this->colspan) { $this->colspan = $child->numberOfColumns(); } } } // ################################################################### /** * Returns the HTML for all printed children elements * * @return string Printed HTML */ protected function _paintChildren() { $builder = ''; $this->_calculateColumnCount(); foreach ($this->children AS $child) { $builder .= "\n" . $child->paint() . "\n"; } return $builder; } // ################################################################### /** * Paints the * * @return string Table HTML code */ public function paint() { return "
" . $this->_paintChildren() . "
"; } } /*=====================================================================* || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>