4 * XHTML 1.1 Tables Module, fully defines accessible table elements.
6 class HTMLPurifier_HTMLModule_Tables
extends HTMLPurifier_HTMLModule
11 public $name = 'Tables';
14 * @param HTMLPurifier_Config $config
16 public function setup($config)
18 $this->addElement('caption', false, 'Inline', 'Common');
23 new HTMLPurifier_ChildDef_Table(),
27 'cellpadding' => 'Length',
28 'cellspacing' => 'Length',
29 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
30 'rules' => 'Enum#none,groups,rows,cols,all',
38 'align' => 'Enum#left,center,right,justify,char',
39 'charoff' => 'Length',
40 'valign' => 'Enum#top,middle,bottom,baseline',
43 $cell_t = array_merge(
46 'colspan' => 'Number',
47 'rowspan' => 'Number',
48 // Apparently, as of HTML5 this attribute only applies
50 'scope' => 'Enum#row,col,rowgroup,colgroup',
54 $this->addElement('td', false, 'Flow', 'Common', $cell_t);
55 $this->addElement('th', false, 'Flow', 'Common', $cell_t);
57 $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);
59 $cell_col = array_merge(
62 'width' => 'MultiLength',
66 $this->addElement('col', false, 'Empty', 'Common', $cell_col);
67 $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);
69 $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);
70 $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);
71 $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);