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