1 <a name="VarTABLE"></a>
3 ### <a name="TABLE{ <em>attributes</em> } -- control"></a> TABLE\{ _attributes_ \} -- control attributes of tables and sorting of table columns
5 - The `%TABLE{}%` variable is handled by the [[TablePlugin]]
6 - Syntax: <code>%TABLE\{ _attributes_ \}%</code>
8 - Supported attributes: <table border="1" cellpadding="0" cellspacing="0">
10 <th bgcolor="#99CCCC"><strong> Argument </strong></th>
11 <th bgcolor="#99CCCC"><strong> Comment </strong></th>
12 <th bgcolor="#99CCCC"><strong> Default value </strong></th>
13 <th bgcolor="#99CCCC"><strong> Example </strong></th>
16 <td><code>sort</code></td>
17 <td> Set table sorting by clicking headers <code>"on"</code> or <code>"off"</code>. </td>
18 <td><span>unspecified</span></td>
19 <td><code>sort="on"</code></td>
22 <td><code>initsort</code></td>
23 <td> Column to sort initially (<code>"1"</code> to number of columns). </td>
24 <td><span>unspecified</span></td>
25 <td><code>initsort="2"</code></td>
28 <td><code>initdirection</code></td>
29 <td> Initial sorting direction for <code>initsort</code>, set to <code>"up"</code> (descending) or <code>"down"</code> (ascending). </td>
30 <td><span>unspecified</span></td>
31 <td><code>initdirection="up"</code></td>
34 <td><code>disableallsort</code></td>
35 <td> Disable all sorting, both initsort and header sort. This is mainly used by plugins such as the [[Main/EditTablePlugin]] to disable sorting in a table while editing the table. </td>
36 <td><span>unspecified</span></td>
37 <td><code>disableallsort="on"</code></td>
40 <td><code>headerbg</code></td>
41 <td> Header cell background colour. </td>
42 <td><code>"#6b7f93"</code></td>
43 <td><code>headerbg="#999999"</code></td>
46 <td><code>headerbgsorted</code></td>
47 <td> Header cell background colour of a sorted column. </td>
48 <td> the value of <code>headerbg</code></td>
49 <td><code>headerbgsorted="#32596c"</code></td>
52 <td><code>headercolor</code></td>
53 <td> Header cell text colour. </td>
54 <td><code>"#ffffff"</code></td>
55 <td><code>headercolor="#0000cc"</code></td>
58 <td><code>databg</code></td>
59 <td> Data cell background colour, a comma separated list. Specify <code>"none"</code> for no colour, that is to use the colour/background of the page the table is on. </td>
60 <td><code>"#edf4f9,#ffffff"</code></td>
61 <td><code>databg="#f2f2f2,#ffffff"</code></td>
64 <td><code>databgsorted</code></td>
65 <td> Data cell background colour of a sorted column; see <code>databg</code>. </td>
66 <td> the values of <code>databg</code></td>
67 <td><code>databgsorted="#d4e8e4,#e5f5ea"</code></td>
70 <td><code>datacolor</code></td>
71 <td> Data cell text colour, a comma separated list. </td>
72 <td><span>unspecified</span></td>
73 <td><code>datacolor="#0000CC, #000000"</code></td>
76 <td><code>tableborder</code></td>
77 <td> Table border width (pixels). </td>
78 <td><code>"1"</code></td>
79 <td><code>tableborder="2"</code></td>
82 <td><code>tableframe</code></td>
83 <td> Table frame, set to <code>"void"</code> (no sides), <code>"above"</code> (the top side only), <code>"below"</code> (the bottom side only), <code>"hsides"</code> (the top and bottom sides only), <code>"lhs"</code> (the left-hand side only), <code>"rhs"</code> (the right-hand side only), <code>"vsides"</code> (the right and left sides only), <code>"box"</code> (all four sides), <code>"border"</code> (all four sides). </td>
84 <td><span>unspecified</span></td>
85 <td><code>tableframe="hsides"</code></td>
88 <td><code>tablerules</code></td>
89 <td> Table rules, set to <code>"none"</code> (no rules), <code>"groups"</code> (rules will appear between row groups and column groups only), <code>"rows"</code> (rules will appear between rows only), <code>"cols"</code> (rules will appear between columns only), <code>"all"</code> (rules will appear between all rows and columns). </td>
90 <td><span>unspecified</span></td>
91 <td><code>tablerules="rows"</code></td>
94 <td><code>cellpadding</code></td>
95 <td> Cell padding (pixels). </td>
96 <td><code>"0"</code></td>
97 <td><code>cellpadding="0"</code></td>
100 <td><code>cellspacing</code></td>
101 <td> Cell spacing (pixels). </td>
102 <td><code>"0"</code></td>
103 <td><code>cellspacing="3"</code></td>
106 <td><code>cellborder</code></td>
107 <td> Cell border width (pixels). </td>
108 <td><span>unspecified</span></td>
109 <td><code>cellborder="0"</code></td>
112 <td><code>valign</code></td>
113 <td> Vertical alignment of cells and headers, set to <code>"top"</code>, <code>"middle"</code>, <code>"bottom"</code> or <code>"baseline"</code>. </td>
114 <td><span>unspecified</span></td>
115 <td><code>valign="top"</code></td>
118 <td><code>headervalign</code></td>
119 <td> Vertical alignment of header cells; overrides <code>valign</code>. </td>
120 <td><span>unspecified</span></td>
121 <td><code>headervalign="top"</code></td>
124 <td><code>datavalign</code></td>
125 <td> Vertical alignment of data cells; overrides <code>valign</code>. </td>
126 <td><span>unspecified</span></td>
127 <td><code>datavalign="top"</code></td>
130 <td><code>headeralign</code></td>
131 <td> Header cell alignment, one value for all columns, or a comma separated list for different alignment of individual columns. Set to <code>"left"</code>, <code>"center"</code>, <code>"right"</code> or <code>"justify"</code>. Overrides individual cell settings. </td>
132 <td><span>unspecified</span></td>
133 <td><code>headeralign="left,right"</code></td>
136 <td><code>dataalign</code></td>
137 <td> Data cell alignment, one value for all columns, or a comma separated list for different alignment of individual columns. Set to <code>"left"</code>, <code>"center"</code>, <code>"right"</code> or <code>"justify"</code>. Overrides individual cell settings. </td>
138 <td><span>unspecified</span></td>
139 <td><code>dataalign="center"</code></td>
142 <td><code>tablewidth</code></td>
143 <td> Table width: Percentage of window width, or absolute pixel value. </td>
144 <td><span>unspecified</span></td>
145 <td><code>tablewidth="100%"</code></td>
148 <td><code>columnwidths</code></td>
149 <td> Column widths: Comma delimited list of column widths, percentage or absolute pixel value. </td>
150 <td><span>unspecified</span></td>
151 <td><code>columnwidths="80%,20%"</code></td>
154 <td><code>headerrows</code></td>
155 <td> Number of header rows to exclude from sort. (will be rendered in a HTML <code>thead</code> section) </td>
156 <td><code>"1"</code></td>
157 <td><code>headerrows="1"</code></td>
160 <td><code>footerrows</code></td>
161 <td> Number of footer rows to exclude from sort. (will be rendered in a HTML <code>tfoot</code> section) </td>
162 <td><code>"0"</code></td>
163 <td><code>footerrows="1"</code></td>
166 <td><code>id</code></td>
167 <td> Unique table identifier string, used for targeting a table with CSS. </td>
168 <td><code>tableN</code> (where N is the table order number on the page) </td>
169 <td><code>id="userTable"</code></td>
172 <td><code>summary</code></td>
173 <td> Table summary used by screenreaders: A summary of what the table presents. It should provide an orientation for someone who listens to the table. </td>
174 <td><span>unspecified</span></td>
175 <td><code>summary="List of subscribed users"</code></td>
178 <td><code>caption</code></td>
179 <td> Table caption: A title that will be displayed just above the table. </td>
180 <td><span>unspecified</span></td>
181 <td><code>caption="Users"</code></td>
185 - Example:%BR% `%TABLE{ tableborder="0" cellpadding="4" cellspacing="3" cellborder="0" }%` %BR% `| *A1* | *B1* |` %BR% `| A2 | B2 |`
186 - Related: See [[TablePlugin]] for more details