(no commit message)
[openafs-wiki.git] / TWiki / VarTABLE.mdwn
1 <a name="VarTABLE"></a>
2
3 ### <a name="TABLE{ &lt;em&gt;attributes&lt;/em&gt; } -- control"></a> TABLE\{ _attributes_ \} -- control attributes of tables and sorting of table columns
4
5 - The `%TABLE{}%` variable is handled by the [[TablePlugin]]
6 - Syntax: <code>%TABLE\{ _attributes_ \}%</code>
7
8 - Supported attributes: <table border="1" cellpadding="0" cellspacing="0">
9   <tr>
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>
14   </tr>
15   <tr>
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>
20   </tr>
21   <tr>
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>
26   </tr>
27   <tr>
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>
32   </tr>
33   <tr>
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>
38   </tr>
39   <tr>
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>
44   </tr>
45   <tr>
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>
50   </tr>
51   <tr>
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>
56   </tr>
57   <tr>
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>
62   </tr>
63   <tr>
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>
68   </tr>
69   <tr>
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>
74   </tr>
75   <tr>
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>
80   </tr>
81   <tr>
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>
86   </tr>
87   <tr>
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>
92   </tr>
93   <tr>
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>
98   </tr>
99   <tr>
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>
104   </tr>
105   <tr>
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>
110   </tr>
111   <tr>
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>
116   </tr>
117   <tr>
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>
122   </tr>
123   <tr>
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>
128   </tr>
129   <tr>
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>
134   </tr>
135   <tr>
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>
140   </tr>
141   <tr>
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>
146   </tr>
147   <tr>
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>
152   </tr>
153   <tr>
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>
158   </tr>
159   <tr>
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>
164   </tr>
165   <tr>
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>
170   </tr>
171   <tr>
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>
176   </tr>
177   <tr>
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>
182   </tr>
183 </table>
184
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