1: <?php
2: /**
3: * This file contains the cHTMLTable class.
4: *
5: * @package Core
6: * @subpackage GUI_HTML
7: * @version SVN Revision $Rev:$
8: *
9: * @author Simon Sprankel
10: * @copyright four for business AG <www.4fb.de>
11: * @license http://www.contenido.org/license/LIZENZ.txt
12: * @link http://www.4fb.de
13: * @link http://www.contenido.org
14: */
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: /**
19: * cHTMLTable class represents a table.
20: *
21: * @package Core
22: * @subpackage GUI_HTML
23: */
24: class cHTMLTable extends cHTMLContentElement {
25:
26: /**
27: * Creates an HTML table element.
28: */
29: public function __construct() {
30: parent::__construct();
31:
32: $this->_tag = 'table';
33: $this->setPadding(0);
34: $this->setSpacing(0);
35: $this->setBorder(NULL);
36: }
37:
38: /**
39: * Sets the spacing between cells
40: *
41: * @param string $cellspacing Spacing
42: * @return cHTMLTable $this
43: */
44: public function setCellSpacing($cellspacing) {
45: return $this->updateAttribute('cellspacing', $cellspacing);
46: }
47:
48: /**
49: * Alias for setCellSpacing
50: *
51: * @param string $cellspacing
52: * @return cHTMLTable $this
53: */
54: public function setSpacing($cellspacing) {
55: return $this->setCellSpacing($cellspacing);
56: }
57:
58: /**
59: * Sets the padding between cells
60: *
61: * @param string $cellpadding Padding
62: * @return cHTMLTable $this
63: */
64: public function setCellPadding($cellpadding) {
65: return $this->updateAttribute('cellpadding', $cellpadding);
66: }
67:
68: /**
69: * Alias for setCellPadding
70: *
71: * @param string $cellpadding
72: * @return cHTMLTable $this
73: */
74: public function setPadding($cellpadding) {
75: return $this->setCellPadding($cellpadding);
76: }
77:
78: /**
79: * Sets the table's border
80: *
81: * @param string $border Border size
82: * @return cHTMLTable $this
83: */
84: public function setBorder($border) {
85: return $this->updateAttribute('border', $border);
86: }
87:
88: /**
89: * setWidth: Sets the table width
90: *
91: * @param string $width Width
92: * @return cHTMLTable $this
93: */
94: public function setWidth($width) {
95: return $this->updateAttribute('width', $width);
96: }
97:
98: }
99: