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: * @return void
30: */
31: public function __construct() {
32: parent::__construct();
33:
34: $this->_tag = 'table';
35: $this->setPadding(0);
36: $this->setSpacing(0);
37: $this->setBorder(null);
38: }
39:
40: /**
41: * Sets the spacing between cells
42: *
43: * @param string $cellspacing Spacing
44: * @return cHTMLTable $this
45: */
46: public function setCellSpacing($cellspacing) {
47: return $this->updateAttribute('cellspacing', $cellspacing);
48: }
49:
50: /**
51: * Alias for setCellSpacing
52: *
53: * @param string $cellspacing
54: * @return cHTMLTable $this
55: */
56: public function setSpacing($cellspacing) {
57: return $this->setCellSpacing($cellspacing);
58: }
59:
60: /**
61: * Sets the padding between cells
62: *
63: * @param string $cellpadding Padding
64: * @return cHTMLTable $this
65: */
66: public function setCellPadding($cellpadding) {
67: return $this->updateAttribute('cellpadding', $cellpadding);
68: }
69:
70: /**
71: * Alias for setCellPadding
72: *
73: * @param string $cellpadding
74: * @return cHTMLTable $this
75: */
76: public function setPadding($cellpadding) {
77: return $this->setCellPadding($cellpadding);
78: }
79:
80: /**
81: * Sets the table's border
82: *
83: * @param string $border Border size
84: * @return cHTMLTable $this
85: */
86: public function setBorder($border) {
87: return $this->updateAttribute('border', $border);
88: }
89:
90: /**
91: * setWidth: Sets the table width
92: *
93: * @param $width Width
94: * @return cHTMLTable $this
95: */
96: public function setWidth($width) {
97: return $this->updateAttribute('width', $width);
98: }
99:
100: }
101: