4 * XHTML 1.1 Tables Module, fully defines accessible table elements.
6 class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
9 public $name = 'Tables';
11 public function setup($config) {
13 $this->addElement('caption', false, 'Inline', 'Common');
15 $this->addElement('table', 'Block',
16 new HTMLPurifier_ChildDef_Table(), 'Common',
19 'cellpadding' => 'Length',
20 'cellspacing' => 'Length',
21 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
22 'rules' => 'Enum#none,groups,rows,cols,all',
30 'align' => 'Enum#left,center,right,justify,char',
31 'charoff' => 'Length',
32 'valign' => 'Enum#top,middle,bottom,baseline',
35 $cell_t = array_merge(
38 'colspan' => 'Number',
39 'rowspan' => 'Number',
43 $this->addElement('td', false, 'Flow', 'Common', $cell_t);
44 $this->addElement('th', false, 'Flow', 'Common', $cell_t);
46 $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);
48 $cell_col = array_merge(
51 'width' => 'MultiLength',
55 $this->addElement('col', false, 'Empty', 'Common', $cell_col);
56 $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);
58 $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);
59 $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);
60 $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);