0
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
2 <html>
|
|
3 <head>
|
|
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
5 <link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico">
|
|
6
|
|
7 <title>FixedColumns example</title>
|
|
8 <style type="text/css" title="currentStyle">
|
|
9 @import "../../media/css/demo_page.css";
|
|
10 @import "../../media/css/demo_table.css";
|
|
11 tr { height: 50px; }
|
|
12 </style>
|
|
13 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
|
|
14 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script>
|
|
15 <script type="text/javascript" charset="utf-8" src="media/js/FixedColumns.js"></script>
|
|
16 <script type="text/javascript" charset="utf-8">
|
|
17 $(document).ready( function () {
|
|
18 var iStart = new Date().getTime();
|
|
19 var oTable = $('#example').dataTable( {
|
|
20 "sScrollY": "300px",
|
|
21 "sScrollX": "100%",
|
|
22 "sScrollXInner": "150%",
|
|
23 "bScrollCollapse": true,
|
|
24 "bPaginate": false
|
|
25 } );
|
|
26 new FixedColumns( oTable, {
|
|
27 "sHeightMatch": "none"
|
|
28 } );
|
|
29 } );
|
|
30 </script>
|
|
31 </head>
|
|
32 <body id="dt_example">
|
|
33 <div id="container">
|
|
34 <div class="full_width big">
|
|
35 FixedColumns example - CSS row sizing
|
|
36 </div>
|
|
37
|
|
38 <h1>Preamble</h1>
|
|
39 <p>Because of the method FixedColumns uses to display the fixed columns, an important consideration is the alignment of the rows due to different heights in the individual rows of the table. There are two different algorithms in FixedColumns which can be used, or you can switch off automatic row sizing all together. This is controlled through the <i>sHeightMatch</i> parameter. If can take the following values:</p>
|
|
40
|
|
41 <ul>
|
|
42 <li>"none" - no automatic row height matching is performed. CSS can be used in this case and is useful when speed is of primary importance.</li>
|
|
43 <li>"semiauto" (default) - the height calculation will be performed once, and the result cached to be used again (fnRecalculateHeight can be used to force recalculation)</li>
|
|
44 <li>"auto" - height matching is performed on every draw (slowest but must accurate)</li>
|
|
45 </ul>
|
|
46
|
|
47 <p>This example shows row height matching switched off but there is a CSS statement of tr { height: 50px } to force all rows to the same height.</p>
|
|
48
|
|
49 <h1>Live example</h1>
|
|
50 <div id="demo">
|
|
51 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
|
52 <thead>
|
|
53 <tr>
|
|
54 <th>Rendering engine</th>
|
|
55 <th>Browser</th>
|
|
56 <th>Platform(s)</th>
|
|
57 <th>Engine version</th>
|
|
58 <th>CSS grade</th>
|
|
59 </tr>
|
|
60 </thead>
|
|
61 <tfoot>
|
|
62 <tr>
|
|
63 <th>Rendering engine</th>
|
|
64 <th>Browser</th>
|
|
65 <th>Platform(s)</th>
|
|
66 <th>Engine version</th>
|
|
67 <th>CSS grade</th>
|
|
68 </tr>
|
|
69 </tfoot>
|
|
70 <tbody>
|
|
71 <tr class="gradeX">
|
|
72 <td>Trident</td>
|
|
73 <td>Internet
|
|
74 Explorer 4.0</td>
|
|
75 <td>Win 95+</td>
|
|
76 <td class="center">4</td>
|
|
77 <td class="center">X</td>
|
|
78 </tr>
|
|
79 <tr class="gradeC">
|
|
80 <td>Trident</td>
|
|
81 <td>Internet
|
|
82 Explorer 5.0</td>
|
|
83 <td>Win 95+</td>
|
|
84 <td class="center">5</td>
|
|
85 <td class="center">C</td>
|
|
86 </tr>
|
|
87 <tr class="gradeA">
|
|
88 <td>Trident</td>
|
|
89 <td>Internet
|
|
90 Explorer 5.5</td>
|
|
91 <td>Win 95+</td>
|
|
92 <td class="center">5.5</td>
|
|
93 <td class="center">A</td>
|
|
94 </tr>
|
|
95 <tr class="gradeA">
|
|
96 <td>Trident</td>
|
|
97 <td>Internet
|
|
98 Explorer 6</td>
|
|
99 <td>Win 98+</td>
|
|
100 <td class="center">6</td>
|
|
101 <td class="center">A</td>
|
|
102 </tr>
|
|
103 <tr class="gradeA">
|
|
104 <td>Trident</td>
|
|
105 <td>Internet Explorer 7</td>
|
|
106 <td>Win XP SP2+</td>
|
|
107 <td class="center">7</td>
|
|
108 <td class="center">A</td>
|
|
109 </tr>
|
|
110 <tr class="gradeA">
|
|
111 <td>Trident</td>
|
|
112 <td>AOL browser (AOL desktop)</td>
|
|
113 <td>Win XP</td>
|
|
114 <td class="center">6</td>
|
|
115 <td class="center">A</td>
|
|
116 </tr>
|
|
117 <tr class="gradeA">
|
|
118 <td>Gecko</td>
|
|
119 <td>Firefox 1.0</td>
|
|
120 <td>Win 98+ / OSX.2+</td>
|
|
121 <td class="center">1.7</td>
|
|
122 <td class="center">A</td>
|
|
123 </tr>
|
|
124 <tr class="gradeA">
|
|
125 <td>Gecko</td>
|
|
126 <td>Firefox <br>1.5</td>
|
|
127 <td>Win 98+ / OSX.2+</td>
|
|
128 <td class="center">1.8</td>
|
|
129 <td class="center">A</td>
|
|
130 </tr>
|
|
131 <tr class="gradeA">
|
|
132 <td>Gecko</td>
|
|
133 <td>Firefox 2.0</td>
|
|
134 <td>Win 98+ / OSX.2+</td>
|
|
135 <td class="center">1.8</td>
|
|
136 <td class="center">A</td>
|
|
137 </tr>
|
|
138 <tr class="gradeA">
|
|
139 <td>Gecko</td>
|
|
140 <td>Firefox 3.0</td>
|
|
141 <td>Win 2k+ / OSX.3+</td>
|
|
142 <td class="center">1.9</td>
|
|
143 <td class="center">A</td>
|
|
144 </tr>
|
|
145 <tr class="gradeA">
|
|
146 <td>Gecko</td>
|
|
147 <td>Camino 1.0</td>
|
|
148 <td>OSX.2+</td>
|
|
149 <td class="center">1.8</td>
|
|
150 <td class="center">A</td>
|
|
151 </tr>
|
|
152 <tr class="gradeA">
|
|
153 <td>Gecko</td>
|
|
154 <td>Camino 1.5</td>
|
|
155 <td>OSX.3+</td>
|
|
156 <td class="center">1.8</td>
|
|
157 <td class="center">A</td>
|
|
158 </tr>
|
|
159 <tr class="gradeA">
|
|
160 <td>Gecko</td>
|
|
161 <td>Netscape 7.2</td>
|
|
162 <td>Win 95+ / Mac OS 8.6-9.2</td>
|
|
163 <td class="center">1.7</td>
|
|
164 <td class="center">A</td>
|
|
165 </tr>
|
|
166 <tr class="gradeA">
|
|
167 <td>Gecko</td>
|
|
168 <td>Netscape Browser 8</td>
|
|
169 <td>Win 98SE+</td>
|
|
170 <td class="center">1.7</td>
|
|
171 <td class="center">A</td>
|
|
172 </tr>
|
|
173 <tr class="gradeA">
|
|
174 <td>Gecko</td>
|
|
175 <td>Netscape Navigator 9</td>
|
|
176 <td>Win 98+ / OSX.2+</td>
|
|
177 <td class="center">1.8</td>
|
|
178 <td class="center">A</td>
|
|
179 </tr>
|
|
180 <tr class="gradeA">
|
|
181 <td>Gecko</td>
|
|
182 <td>Mozilla 1.0</td>
|
|
183 <td>Win 95+ / OSX.1+</td>
|
|
184 <td class="center">1</td>
|
|
185 <td class="center">A</td>
|
|
186 </tr>
|
|
187 <tr class="gradeA">
|
|
188 <td>Gecko</td>
|
|
189 <td>Mozilla 1.1</td>
|
|
190 <td>Win 95+ / OSX.1+</td>
|
|
191 <td class="center">1.1</td>
|
|
192 <td class="center">A</td>
|
|
193 </tr>
|
|
194 <tr class="gradeA">
|
|
195 <td>Gecko</td>
|
|
196 <td>Mozilla 1.2</td>
|
|
197 <td>Win 95+ / OSX.1+</td>
|
|
198 <td class="center">1.2</td>
|
|
199 <td class="center">A</td>
|
|
200 </tr>
|
|
201 <tr class="gradeA">
|
|
202 <td>Gecko</td>
|
|
203 <td>Mozilla 1.3</td>
|
|
204 <td>Win 95+ / OSX.1+</td>
|
|
205 <td class="center">1.3</td>
|
|
206 <td class="center">A</td>
|
|
207 </tr>
|
|
208 <tr class="gradeA">
|
|
209 <td>Gecko</td>
|
|
210 <td>Mozilla 1.4</td>
|
|
211 <td>Win 95+ / OSX.1+</td>
|
|
212 <td class="center">1.4</td>
|
|
213 <td class="center">A</td>
|
|
214 </tr>
|
|
215 <tr class="gradeA">
|
|
216 <td>Gecko</td>
|
|
217 <td>Mozilla 1.5</td>
|
|
218 <td>Win 95+ / OSX.1+</td>
|
|
219 <td class="center">1.5</td>
|
|
220 <td class="center">A</td>
|
|
221 </tr>
|
|
222 <tr class="gradeA">
|
|
223 <td>Gecko</td>
|
|
224 <td>Mozilla 1.6</td>
|
|
225 <td>Win 95+ / OSX.1+</td>
|
|
226 <td class="center">1.6</td>
|
|
227 <td class="center">A</td>
|
|
228 </tr>
|
|
229 <tr class="gradeA">
|
|
230 <td>Gecko</td>
|
|
231 <td>Mozilla 1.7</td>
|
|
232 <td>Win 98+ / OSX.1+</td>
|
|
233 <td class="center">1.7</td>
|
|
234 <td class="center">A</td>
|
|
235 </tr>
|
|
236 <tr class="gradeA">
|
|
237 <td>Gecko</td>
|
|
238 <td>Mozilla 1.8</td>
|
|
239 <td>Win 98+ / OSX.1+</td>
|
|
240 <td class="center">1.8</td>
|
|
241 <td class="center">A</td>
|
|
242 </tr>
|
|
243 <tr class="gradeA">
|
|
244 <td>Gecko</td>
|
|
245 <td>Seamonkey 1.1</td>
|
|
246 <td>Win 98+ / OSX.2+</td>
|
|
247 <td class="center">1.8</td>
|
|
248 <td class="center">A</td>
|
|
249 </tr>
|
|
250 <tr class="gradeA">
|
|
251 <td>Gecko</td>
|
|
252 <td>Epiphany 2.20</td>
|
|
253 <td>Gnome</td>
|
|
254 <td class="center">1.8</td>
|
|
255 <td class="center">A</td>
|
|
256 </tr>
|
|
257 <tr class="gradeA">
|
|
258 <td>Webkit</td>
|
|
259 <td>Safari 1.2</td>
|
|
260 <td>OSX.3</td>
|
|
261 <td class="center">125.5</td>
|
|
262 <td class="center">A</td>
|
|
263 </tr>
|
|
264 <tr class="gradeA">
|
|
265 <td>Webkit</td>
|
|
266 <td>Safari 1.3</td>
|
|
267 <td>OSX.3</td>
|
|
268 <td class="center">312.8</td>
|
|
269 <td class="center">A</td>
|
|
270 </tr>
|
|
271 <tr class="gradeA">
|
|
272 <td>Webkit</td>
|
|
273 <td>Safari 2.0</td>
|
|
274 <td>OSX.4+</td>
|
|
275 <td class="center">419.3</td>
|
|
276 <td class="center">A</td>
|
|
277 </tr>
|
|
278 <tr class="gradeA">
|
|
279 <td>Webkit</td>
|
|
280 <td>Safari 3.0</td>
|
|
281 <td>OSX.4+</td>
|
|
282 <td class="center">522.1</td>
|
|
283 <td class="center">A</td>
|
|
284 </tr>
|
|
285 <tr class="gradeA">
|
|
286 <td>Webkit</td>
|
|
287 <td>OmniWeb 5.5</td>
|
|
288 <td>OSX.4+</td>
|
|
289 <td class="center">420</td>
|
|
290 <td class="center">A</td>
|
|
291 </tr>
|
|
292 <tr class="gradeA">
|
|
293 <td>Webkit</td>
|
|
294 <td>iPod Touch / iPhone</td>
|
|
295 <td>iPod</td>
|
|
296 <td class="center">420.1</td>
|
|
297 <td class="center">A</td>
|
|
298 </tr>
|
|
299 <tr class="gradeA">
|
|
300 <td>Webkit</td>
|
|
301 <td>S60</td>
|
|
302 <td>S60</td>
|
|
303 <td class="center">413</td>
|
|
304 <td class="center">A</td>
|
|
305 </tr>
|
|
306 <tr class="gradeA">
|
|
307 <td>Presto</td>
|
|
308 <td>Opera 7.0</td>
|
|
309 <td>Win 95+ / OSX.1+</td>
|
|
310 <td class="center">-</td>
|
|
311 <td class="center">A</td>
|
|
312 </tr>
|
|
313 <tr class="gradeA">
|
|
314 <td>Presto</td>
|
|
315 <td>Opera 7.5</td>
|
|
316 <td>Win 95+ / OSX.2+</td>
|
|
317 <td class="center">-</td>
|
|
318 <td class="center">A</td>
|
|
319 </tr>
|
|
320 <tr class="gradeA">
|
|
321 <td>Presto</td>
|
|
322 <td>Opera 8.0</td>
|
|
323 <td>Win 95+ / OSX.2+</td>
|
|
324 <td class="center">-</td>
|
|
325 <td class="center">A</td>
|
|
326 </tr>
|
|
327 <tr class="gradeA">
|
|
328 <td>Presto</td>
|
|
329 <td>Opera 8.5</td>
|
|
330 <td>Win 95+ / OSX.2+</td>
|
|
331 <td class="center">-</td>
|
|
332 <td class="center">A</td>
|
|
333 </tr>
|
|
334 <tr class="gradeA">
|
|
335 <td>Presto</td>
|
|
336 <td>Opera 9.0</td>
|
|
337 <td>Win 95+ / OSX.3+</td>
|
|
338 <td class="center">-</td>
|
|
339 <td class="center">A</td>
|
|
340 </tr>
|
|
341 <tr class="gradeA">
|
|
342 <td>Presto</td>
|
|
343 <td>Opera 9.2</td>
|
|
344 <td>Win 88+ / OSX.3+</td>
|
|
345 <td class="center">-</td>
|
|
346 <td class="center">A</td>
|
|
347 </tr>
|
|
348 <tr class="gradeA">
|
|
349 <td>Presto</td>
|
|
350 <td>Opera 9.5</td>
|
|
351 <td>Win 88+ / OSX.3+</td>
|
|
352 <td class="center">-</td>
|
|
353 <td class="center">A</td>
|
|
354 </tr>
|
|
355 <tr class="gradeA">
|
|
356 <td>Presto</td>
|
|
357 <td>Opera for Wii</td>
|
|
358 <td>Wii</td>
|
|
359 <td class="center">-</td>
|
|
360 <td class="center">A</td>
|
|
361 </tr>
|
|
362 <tr class="gradeA">
|
|
363 <td>Presto</td>
|
|
364 <td>Nokia N800</td>
|
|
365 <td>N800</td>
|
|
366 <td class="center">-</td>
|
|
367 <td class="center">A</td>
|
|
368 </tr>
|
|
369 <tr class="gradeA">
|
|
370 <td>Presto</td>
|
|
371 <td>Nintendo DS browser</td>
|
|
372 <td>Nintendo DS</td>
|
|
373 <td class="center">8.5</td>
|
|
374 <td class="center">C/A</td>
|
|
375 </tr>
|
|
376 <tr class="gradeC">
|
|
377 <td>KHTML</td>
|
|
378 <td>Konqureror 3.1</td>
|
|
379 <td>KDE 3.1</td>
|
|
380 <td class="center">3.1</td>
|
|
381 <td class="center">C</td>
|
|
382 </tr>
|
|
383 <tr class="gradeA">
|
|
384 <td>KHTML</td>
|
|
385 <td>Konqureror 3.3</td>
|
|
386 <td>KDE 3.3</td>
|
|
387 <td class="center">3.3</td>
|
|
388 <td class="center">A</td>
|
|
389 </tr>
|
|
390 <tr class="gradeA">
|
|
391 <td>KHTML</td>
|
|
392 <td>Konqureror 3.5</td>
|
|
393 <td>KDE 3.5</td>
|
|
394 <td class="center">3.5</td>
|
|
395 <td class="center">A</td>
|
|
396 </tr>
|
|
397 <tr class="gradeX">
|
|
398 <td>Tasman</td>
|
|
399 <td>Internet Explorer 4.5</td>
|
|
400 <td>Mac OS 8-9</td>
|
|
401 <td class="center">-</td>
|
|
402 <td class="center">X</td>
|
|
403 </tr>
|
|
404 <tr class="gradeC">
|
|
405 <td>Tasman</td>
|
|
406 <td>Internet Explorer 5.1</td>
|
|
407 <td>Mac OS 7.6-9</td>
|
|
408 <td class="center">1</td>
|
|
409 <td class="center">C</td>
|
|
410 </tr>
|
|
411 <tr class="gradeC">
|
|
412 <td>Tasman</td>
|
|
413 <td>Internet Explorer 5.2</td>
|
|
414 <td>Mac OS 8-X</td>
|
|
415 <td class="center">1</td>
|
|
416 <td class="center">C</td>
|
|
417 </tr>
|
|
418 <tr class="gradeA">
|
|
419 <td>Misc</td>
|
|
420 <td>NetFront 3.1</td>
|
|
421 <td>Embedded devices</td>
|
|
422 <td class="center">-</td>
|
|
423 <td class="center">C</td>
|
|
424 </tr>
|
|
425 <tr class="gradeA">
|
|
426 <td>Misc</td>
|
|
427 <td>NetFront 3.4</td>
|
|
428 <td>Embedded devices</td>
|
|
429 <td class="center">-</td>
|
|
430 <td class="center">A</td>
|
|
431 </tr>
|
|
432 <tr class="gradeX">
|
|
433 <td>Misc</td>
|
|
434 <td>Dillo 0.8</td>
|
|
435 <td>Embedded devices</td>
|
|
436 <td class="center">-</td>
|
|
437 <td class="center">X</td>
|
|
438 </tr>
|
|
439 <tr class="gradeX">
|
|
440 <td>Misc</td>
|
|
441 <td>Links</td>
|
|
442 <td>Text only</td>
|
|
443 <td class="center">-</td>
|
|
444 <td class="center">X</td>
|
|
445 </tr>
|
|
446 <tr class="gradeX">
|
|
447 <td>Misc</td>
|
|
448 <td>Lynx</td>
|
|
449 <td>Text only</td>
|
|
450 <td class="center">-</td>
|
|
451 <td class="center">X</td>
|
|
452 </tr>
|
|
453 <tr class="gradeC">
|
|
454 <td>Misc</td>
|
|
455 <td>IE Mobile</td>
|
|
456 <td>Windows Mobile 6</td>
|
|
457 <td class="center">-</td>
|
|
458 <td class="center">C</td>
|
|
459 </tr>
|
|
460 <tr class="gradeC">
|
|
461 <td>Misc</td>
|
|
462 <td>PSP browser</td>
|
|
463 <td>PSP</td>
|
|
464 <td class="center">-</td>
|
|
465 <td class="center">C</td>
|
|
466 </tr>
|
|
467 <tr class="gradeU">
|
|
468 <td>Other browsers</td>
|
|
469 <td>All others</td>
|
|
470 <td>-</td>
|
|
471 <td class="center">-</td>
|
|
472 <td class="center">U</td>
|
|
473 </tr>
|
|
474 </tbody>
|
|
475 </table>
|
|
476 </div>
|
|
477 <div class="spacer"></div>
|
|
478
|
|
479
|
|
480 <h1>Initialisation code</h1>
|
|
481 <pre>$(document).ready( function () {
|
|
482 var oTable = $('#example').dataTable( {
|
|
483 "sScrollX": "100%",
|
|
484 "sScrollXInner": "150%",
|
|
485 "bScrollCollapse": true
|
|
486 } );
|
|
487 new FixedColumns( oTable );
|
|
488 } );</pre>
|
|
489
|
|
490
|
|
491 <h1>Documentation</h1>
|
|
492 <ul>
|
|
493 <li><a href="http://datatables.net/extras/fixedcolumns">Usage</a></li>
|
|
494 <li><a href="http://datatables.net/docs/FixedColumns">API / parameters</a></li>
|
|
495 </ul>
|
|
496
|
|
497 <h1>Basic examples</h1>
|
|
498 <ul>
|
|
499 <li><a href="index.html">Basic demo of FixedColumns with zero initialisation</a></li>
|
|
500 <li><a href="left_right_columns.html">Fix the left and right columns in place</a></li>
|
|
501 <li><a href="index_column.html">Index column attached to side of the table</a></li>
|
|
502 <li><a href="x_y_scrolling.html">Index column, but with Y scrolling and no pagination</a></li>
|
|
503 <li><a href="two_columns.html">Two columns fixed in place</a></li>
|
|
504 <li><a href="right_column.html">Fix the right column in place</a></li>
|
|
505 <li><a href="css_size.html">Speeding up row height matching with CSS</a></li>
|
|
506 <li><a href="themed.html">jQuery UI themed table with FixedColumns</a></li>
|
|
507 </ul>
|
|
508
|
|
509 <h1>Advanced examples</h1>
|
|
510 <ul>
|
|
511 <li><a href="rowspan.html">Using ROWSPAN with FixedColumns</a></li>
|
|
512 <li><a href="server-side-processing.html">Server-side processing with FixedColumns</a></li>
|
|
513 <li><a href="col_filter.html">Individual column filtering</a></li>
|
|
514 <li><a href="scale_fixed.html">Setting the fixed column width and resizing the table</a></li>
|
|
515 <li><a href="scale_relative.html">Setting the fixed column width with relative sizing</a></li>
|
|
516 <li><a href="row_grouping_height.html">Row grouping by grouping like rows in the fixed column</a></li>
|
|
517 <li><a href="row_grouping.html">Row grouping by inserting a grouping row</a></li>
|
|
518 <ul>
|
|
519
|
|
520
|
|
521 <div id="footer" style="text-align:center;">
|
|
522 <span style="font-size:10px;">
|
|
523 FixedColumns and DataTables © Allan Jardine 2011.<br>
|
|
524 </span>
|
|
525 </div>
|
|
526 </div>
|
|
527 </body>
|
|
528 </html> |