1: <?php
  2: 
  3: /**
  4:  * This file contains the cHTMLTableData class.
  5:  *
  6:  * @package Core
  7:  * @subpackage GUI_HTML
  8:  * @version SVN Revision $Rev:$
  9:  *
 10:  * @author Simon Sprankel
 11:  * @copyright four for business AG <www.4fb.de>
 12:  * @license http://www.contenido.org/license/LIZENZ.txt
 13:  * @link http://www.4fb.de
 14:  * @link http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: /**
 20:  * cHTMLTableData class represents a table date.
 21:  *
 22:  * @package Core
 23:  * @subpackage GUI_HTML
 24:  */
 25: class cHTMLTableData extends cHTMLContentElement {
 26: 
 27:     /**
 28:      * Constructor.
 29:      *
 30:      * @param mixed $content [optional]
 31:      *         String or object with the contents
 32:      */
 33:     public function __construct($content = NULL) {
 34:         parent::__construct($content);
 35:         $this->_tag = 'td';
 36:     }
 37: 
 38:     /**
 39:      * Sets the table width
 40:      *
 41:      * @param string $width
 42:      *         Width
 43:      * @return cHTMLTableData
 44:      *         $this for chaining
 45:      */
 46:     public function setWidth($width) {
 47:         return $this->updateAttribute('width', $width);
 48:     }
 49: 
 50:     /**
 51:      * Sets the table height
 52:      *
 53:      * @param string $height
 54:      *         Height
 55:      * @return cHTMLTableData
 56:      *         $this for chaining
 57:      */
 58:     public function setHeight($height) {
 59:         return $this->updateAttribute('height', $height);
 60:     }
 61: 
 62:     /**
 63:      * Sets the table alignment
 64:      *
 65:      * @param string $alignment
 66:      *         Alignment
 67:      * @return cHTMLTableData
 68:      *         $this for chaining
 69:      */
 70:     public function setAlignment($alignment) {
 71:         return $this->updateAttribute('align', $alignment);
 72:     }
 73: 
 74:     /**
 75:      * Sets the table vertical alignment
 76:      *
 77:      * @param string $alignment
 78:      *         Vertical Alignment
 79:      * @return cHTMLTableData
 80:      *         $this for chaining
 81:      */
 82:     public function setVerticalAlignment($alignment) {
 83:         return $this->updateAttribute('valign', $alignment);
 84:     }
 85: 
 86:     /**
 87:      * Sets the table background color
 88:      *
 89:      * @param string $color
 90:      *         background color
 91:      * @return cHTMLTableData
 92:      *         $this for chaining
 93:      */
 94:     public function setBackgroundColor($color) {
 95:         return $this->updateAttribute('bgcolor', $color);
 96:     }
 97: 
 98:     /**
 99:      * Sets the table colspan
100:      *
101:      * @param string $colspan
102:      *         Colspan
103:      * @return cHTMLTableData
104:      *         $this for chaining
105:      */
106:     public function setColspan($colspan) {
107:         return $this->updateAttribute('colspan', $colspan);
108:     }
109: 
110: }
111: