1: <?php
2:
3: /**
4: * This file contains the cHTMLTable 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: * cHTMLTable class represents a table.
21: *
22: * @package Core
23: * @subpackage GUI_HTML
24: */
25: class cHTMLTable extends cHTMLContentElement {
26:
27: /**
28: * Creates an HTML table element.
29: */
30: public function __construct() {
31: parent::__construct();
32:
33: $this->_tag = 'table';
34: $this->setPadding(0);
35: $this->setSpacing(0);
36: $this->setBorder(NULL);
37: }
38:
39: /**
40: * Sets the spacing between cells
41: *
42: * @param string $cellspacing
43: * Spacing
44: * @return cHTMLTable
45: * $this for chaining
46: */
47: public function setCellSpacing($cellspacing) {
48: return $this->updateAttribute('cellspacing', $cellspacing);
49: }
50:
51: /**
52: * Alias for setCellSpacing
53: *
54: * @param string $cellspacing
55: * @return cHTMLTable
56: * $this for chaining
57: */
58: public function setSpacing($cellspacing) {
59: return $this->setCellSpacing($cellspacing);
60: }
61:
62: /**
63: * Sets the padding between cells
64: *
65: * @param string $cellpadding
66: * Padding
67: * @return cHTMLTable
68: * $this for chaining
69: */
70: public function setCellPadding($cellpadding) {
71: return $this->updateAttribute('cellpadding', $cellpadding);
72: }
73:
74: /**
75: * Alias for setCellPadding
76: *
77: * @param string $cellpadding
78: * @return cHTMLTable
79: * $this for chaining
80: */
81: public function setPadding($cellpadding) {
82: return $this->setCellPadding($cellpadding);
83: }
84:
85: /**
86: * Sets the table's border
87: *
88: * @param string $border
89: * Border size
90: * @return cHTMLTable
91: * $this for chaining
92: */
93: public function setBorder($border) {
94: return $this->updateAttribute('border', $border);
95: }
96:
97: /**
98: * setWidth: Sets the table width
99: *
100: * @param string $width
101: * Width
102: * @return cHTMLTable
103: * $this for chaining
104: */
105: public function setWidth($width) {
106: return $this->updateAttribute('width', $width);
107: }
108:
109: }
110: