comparison DataTables-1.9.4/extras/FixedColumns/left_right_columns.html @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ac5f9272033b
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 td.indexLeft { background-color: white; border-right: 1px solid black; }
12 td.indexRight { background-color: white; border-left: 1px solid black; }
13 div.DTFC_LeftHeadWrapper th,
14 div.DTFC_RightHeadWrapper th {
15 border-bottom: 1px solid white !important;
16 }
17 div.DTFC_LeftFootWrapper th,
18 div.DTFC_RightFootWrapper th {
19 border-top: 1px solid white !important;
20 }
21 </style>
22 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.js"></script>
23 <script type="text/javascript" charset="utf-8" src="../../media/js/jquery.dataTables.js"></script>
24 <script type="text/javascript" charset="utf-8" src="media/js/FixedColumns.js"></script>
25 <script type="text/javascript" charset="utf-8">
26 $(document).ready( function () {
27 var oTable = $('#example').dataTable( {
28 "sScrollX": "100%",
29 "sScrollXInner": "150%",
30 "bScrollCollapse": true,
31 "fnDrawCallback": function ( oSettings ) {
32 /* Need to redo the counters if filtered or sorted */
33 if ( oSettings.bSorted || oSettings.bFiltered ) {
34 for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ ) {
35 this.fnUpdate( i+1, oSettings.aiDisplay[i], 0, false, false );
36 this.fnUpdate( i+1, oSettings.aiDisplay[i], 6, false, false );
37 }
38 }
39 },
40 "aoColumnDefs": [
41 { "bSortable": false, "sClass": "indexLeft", "aTargets": [ 0 ] },
42 { "bSortable": false, "sClass": "indexRight", "aTargets": [ -1 ] }
43 ],
44 "aaSorting": [[ 1, 'asc' ]]
45 } );
46
47 new FixedColumns( oTable, {
48 "iLeftColumns": 1,
49 "iRightColumns": 1
50 } );
51 } );
52 </script>
53 </head>
54 <body id="dt_example">
55 <div id="container">
56 <div class="full_width big">
57 FixedColumns example - left and right columns fixed
58 </div>
59
60 <h1>Preamble</h1>
61 <p>FixedColumns allows columns to be fixed from both the left and right hand sides of the table. Fixing right hand-side columns is done by using the <i>iRightColumns</i> initialisation parameter, which works just the same as <i>iLeftColumns</i> does for the left side of the table. This example shows both the left and right columns being fixed in place, and a bit of initialisation of DataTables to provide index columns.</p>
62
63 <h1>Live example</h1>
64 <div id="demo">
65 <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
66 <thead>
67 <tr>
68 <th width="3%">&nbsp;</th>
69 <th>Rendering engine</th>
70 <th>Browser</th>
71 <th>Platform(s)</th>
72 <th>Engine version</th>
73 <th>CSS grade</th>
74 <th width="3%">&nbsp;</th>
75 </tr>
76 </thead>
77 <tfoot>
78 <tr>
79 <th width="3%">&nbsp;</th>
80 <th>Rendering engine</th>
81 <th>Browser</th>
82 <th>Platform(s)</th>
83 <th>Engine version</th>
84 <th>CSS grade</th>
85 <th width="3%">&nbsp;</th>
86 </tr>
87 </tfoot>
88 <tbody>
89 <tr class="gradeX">
90 <td class="center">1</td>
91 <td>Trident</td>
92 <td>Internet
93 Explorer 4.0</td>
94 <td>Win 95+</td>
95 <td class="center">4</td>
96 <td class="center">X</td>
97 <td class="center">1</td>
98 </tr>
99 <tr class="gradeC">
100 <td class="center">2</td>
101 <td>Trident</td>
102 <td>Internet
103 Explorer 5.0</td>
104 <td>Win 95+</td>
105 <td class="center">5</td>
106 <td class="center">C</td>
107 <td class="center">2</td>
108 </tr>
109 <tr class="gradeA">
110 <td class="center">3</td>
111 <td>Trident</td>
112 <td>Internet
113 Explorer 5.5</td>
114 <td>Win 95+</td>
115 <td class="center">5.5</td>
116 <td class="center">A</td>
117 <td class="center">3</td>
118 </tr>
119 <tr class="gradeA">
120 <td class="center">4</td>
121 <td>Trident</td>
122 <td>Internet
123 Explorer 6</td>
124 <td>Win 98+</td>
125 <td class="center">6</td>
126 <td class="center">A</td>
127 <td class="center">4</td>
128 </tr>
129 <tr class="gradeA">
130 <td class="center">5</td>
131 <td>Trident</td>
132 <td>Internet Explorer 7</td>
133 <td>Win XP SP2+</td>
134 <td class="center">7</td>
135 <td class="center">A</td>
136 <td class="center">5</td>
137 </tr>
138 <tr class="gradeA">
139 <td class="center">6</td>
140 <td>Trident</td>
141 <td>AOL browser (AOL desktop)</td>
142 <td>Win XP</td>
143 <td class="center">6</td>
144 <td class="center">A</td>
145 <td class="center">6</td>
146 </tr>
147 <tr class="gradeA">
148 <td class="center">7</td>
149 <td>Gecko</td>
150 <td>Firefox 1.0</td>
151 <td>Win 98+ / OSX.2+</td>
152 <td class="center">1.7</td>
153 <td class="center">A</td>
154 <td class="center">7</td>
155 </tr>
156 <tr class="gradeA">
157 <td class="center">8</td>
158 <td>Gecko</td>
159 <td>Firefox 1.5</td>
160 <td>Win 98+ / OSX.2+</td>
161 <td class="center">1.8</td>
162 <td class="center">A</td>
163 <td class="center">8</td>
164 </tr>
165 <tr class="gradeA">
166 <td class="center">9</td>
167 <td>Gecko</td>
168 <td>Firefox 2.0</td>
169 <td>Win 98+ / OSX.2+</td>
170 <td class="center">1.8</td>
171 <td class="center">A</td>
172 <td class="center">9</td>
173 </tr>
174 <tr class="gradeA">
175 <td class="center">10</td>
176 <td>Gecko</td>
177 <td>Firefox 3.0</td>
178 <td>Win 2k+ / OSX.3+</td>
179 <td class="center">1.9</td>
180 <td class="center">A</td>
181 <td class="center">10</td>
182 </tr>
183 <tr class="gradeA">
184 <td class="center">11</td>
185 <td>Gecko</td>
186 <td>Camino 1.0</td>
187 <td>OSX.2+</td>
188 <td class="center">1.8</td>
189 <td class="center">A</td>
190 <td class="center">11</td>
191 </tr>
192 <tr class="gradeA">
193 <td class="center">12</td>
194 <td>Gecko</td>
195 <td>Camino 1.5</td>
196 <td>OSX.3+</td>
197 <td class="center">1.8</td>
198 <td class="center">A</td>
199 <td class="center">12</td>
200 </tr>
201 <tr class="gradeA">
202 <td class="center">13</td>
203 <td>Gecko</td>
204 <td>Netscape 7.2</td>
205 <td>Win 95+ / Mac OS 8.6-9.2</td>
206 <td class="center">1.7</td>
207 <td class="center">A</td>
208 <td class="center">13</td>
209 </tr>
210 <tr class="gradeA">
211 <td class="center">14</td>
212 <td>Gecko</td>
213 <td>Netscape Browser 8</td>
214 <td>Win 98SE+</td>
215 <td class="center">1.7</td>
216 <td class="center">A</td>
217 <td class="center">14</td>
218 </tr>
219 <tr class="gradeA">
220 <td class="center">15</td>
221 <td>Gecko</td>
222 <td>Netscape Navigator 9</td>
223 <td>Win 98+ / OSX.2+</td>
224 <td class="center">1.8</td>
225 <td class="center">A</td>
226 <td class="center">15</td>
227 </tr>
228 <tr class="gradeA">
229 <td class="center">16</td>
230 <td>Gecko</td>
231 <td>Mozilla 1.0</td>
232 <td>Win 95+ / OSX.1+</td>
233 <td class="center">1</td>
234 <td class="center">A</td>
235 <td class="center">16</td>
236 </tr>
237 <tr class="gradeA">
238 <td class="center">17</td>
239 <td>Gecko</td>
240 <td>Mozilla 1.1</td>
241 <td>Win 95+ / OSX.1+</td>
242 <td class="center">1.1</td>
243 <td class="center">A</td>
244 <td class="center">17</td>
245 </tr>
246 <tr class="gradeA">
247 <td class="center">18</td>
248 <td>Gecko</td>
249 <td>Mozilla 1.2</td>
250 <td>Win 95+ / OSX.1+</td>
251 <td class="center">1.2</td>
252 <td class="center">A</td>
253 <td class="center">18</td>
254 </tr>
255 <tr class="gradeA">
256 <td class="center">19</td>
257 <td>Gecko</td>
258 <td>Mozilla 1.3</td>
259 <td>Win 95+ / OSX.1+</td>
260 <td class="center">1.3</td>
261 <td class="center">A</td>
262 <td class="center">19</td>
263 </tr>
264 <tr class="gradeA">
265 <td class="center">20</td>
266 <td>Gecko</td>
267 <td>Mozilla 1.4</td>
268 <td>Win 95+ / OSX.1+</td>
269 <td class="center">1.4</td>
270 <td class="center">A</td>
271 <td class="center">20</td>
272 </tr>
273 <tr class="gradeA">
274 <td class="center">21</td>
275 <td>Gecko</td>
276 <td>Mozilla 1.5</td>
277 <td>Win 95+ / OSX.1+</td>
278 <td class="center">1.5</td>
279 <td class="center">A</td>
280 <td class="center">21</td>
281 </tr>
282 <tr class="gradeA">
283 <td class="center">22</td>
284 <td>Gecko</td>
285 <td>Mozilla 1.6</td>
286 <td>Win 95+ / OSX.1+</td>
287 <td class="center">1.6</td>
288 <td class="center">A</td>
289 <td class="center">22</td>
290 </tr>
291 <tr class="gradeA">
292 <td class="center">23</td>
293 <td>Gecko</td>
294 <td>Mozilla 1.7</td>
295 <td>Win 98+ / OSX.1+</td>
296 <td class="center">1.7</td>
297 <td class="center">A</td>
298 <td class="center">23</td>
299 </tr>
300 <tr class="gradeA">
301 <td class="center">24</td>
302 <td>Gecko</td>
303 <td>Mozilla 1.8</td>
304 <td>Win 98+ / OSX.1+</td>
305 <td class="center">1.8</td>
306 <td class="center">A</td>
307 <td class="center">24</td>
308 </tr>
309 <tr class="gradeA">
310 <td class="center">25</td>
311 <td>Gecko</td>
312 <td>Seamonkey 1.1</td>
313 <td>Win 98+ / OSX.2+</td>
314 <td class="center">1.8</td>
315 <td class="center">A</td>
316 <td class="center">25</td>
317 </tr>
318 <tr class="gradeA">
319 <td class="center">26</td>
320 <td>Gecko</td>
321 <td>Epiphany 2.20</td>
322 <td>Gnome</td>
323 <td class="center">1.8</td>
324 <td class="center">A</td>
325 <td class="center">26</td>
326 </tr>
327 <tr class="gradeA">
328 <td class="center">27</td>
329 <td>Webkit</td>
330 <td>Safari 1.2</td>
331 <td>OSX.3</td>
332 <td class="center">125.5</td>
333 <td class="center">A</td>
334 <td class="center">27</td>
335 </tr>
336 <tr class="gradeA">
337 <td class="center">28</td>
338 <td>Webkit</td>
339 <td>Safari 1.3</td>
340 <td>OSX.3</td>
341 <td class="center">312.8</td>
342 <td class="center">A</td>
343 <td class="center">28</td>
344 </tr>
345 <tr class="gradeA">
346 <td class="center">29</td>
347 <td>Webkit</td>
348 <td>Safari 2.0</td>
349 <td>OSX.4+</td>
350 <td class="center">419.3</td>
351 <td class="center">A</td>
352 <td class="center">29</td>
353 </tr>
354 <tr class="gradeA">
355 <td class="center">30</td>
356 <td>Webkit</td>
357 <td>Safari 3.0</td>
358 <td>OSX.4+</td>
359 <td class="center">522.1</td>
360 <td class="center">A</td>
361 <td class="center">30</td>
362 </tr>
363 <tr class="gradeA">
364 <td class="center">31</td>
365 <td>Webkit</td>
366 <td>OmniWeb 5.5</td>
367 <td>OSX.4+</td>
368 <td class="center">420</td>
369 <td class="center">A</td>
370 <td class="center">31</td>
371 </tr>
372 <tr class="gradeA">
373 <td class="center">32</td>
374 <td>Webkit</td>
375 <td>iPod Touch / iPhone</td>
376 <td>iPod</td>
377 <td class="center">420.1</td>
378 <td class="center">A</td>
379 <td class="center">32</td>
380 </tr>
381 <tr class="gradeA">
382 <td class="center">33</td>
383 <td>Webkit</td>
384 <td>S60</td>
385 <td>S60</td>
386 <td class="center">413</td>
387 <td class="center">A</td>
388 <td class="center">33</td>
389 </tr>
390 <tr class="gradeA">
391 <td class="center">34</td>
392 <td>Presto</td>
393 <td>Opera 7.0</td>
394 <td>Win 95+ / OSX.1+</td>
395 <td class="center">-</td>
396 <td class="center">A</td>
397 <td class="center">34</td>
398 </tr>
399 <tr class="gradeA">
400 <td class="center">35</td>
401 <td>Presto</td>
402 <td>Opera 7.5</td>
403 <td>Win 95+ / OSX.2+</td>
404 <td class="center">-</td>
405 <td class="center">A</td>
406 <td class="center">35</td>
407 </tr>
408 <tr class="gradeA">
409 <td class="center">36</td>
410 <td>Presto</td>
411 <td>Opera 8.0</td>
412 <td>Win 95+ / OSX.2+</td>
413 <td class="center">-</td>
414 <td class="center">A</td>
415 <td class="center">36</td>
416 </tr>
417 <tr class="gradeA">
418 <td class="center">37</td>
419 <td>Presto</td>
420 <td>Opera 8.5</td>
421 <td>Win 95+ / OSX.2+</td>
422 <td class="center">-</td>
423 <td class="center">A</td>
424 <td class="center">37</td>
425 </tr>
426 <tr class="gradeA">
427 <td class="center">38</td>
428 <td>Presto</td>
429 <td>Opera 9.0</td>
430 <td>Win 95+ / OSX.3+</td>
431 <td class="center">-</td>
432 <td class="center">A</td>
433 <td class="center">38</td>
434 </tr>
435 <tr class="gradeA">
436 <td class="center">39</td>
437 <td>Presto</td>
438 <td>Opera 9.2</td>
439 <td>Win 88+ / OSX.3+</td>
440 <td class="center">-</td>
441 <td class="center">A</td>
442 <td class="center">39</td>
443 </tr>
444 <tr class="gradeA">
445 <td class="center">40</td>
446 <td>Presto</td>
447 <td>Opera 9.5</td>
448 <td>Win 88+ / OSX.3+</td>
449 <td class="center">-</td>
450 <td class="center">A</td>
451 <td class="center">40</td>
452 </tr>
453 <tr class="gradeA">
454 <td class="center">41</td>
455 <td>Presto</td>
456 <td>Opera for Wii</td>
457 <td>Wii</td>
458 <td class="center">-</td>
459 <td class="center">A</td>
460 <td class="center">41</td>
461 </tr>
462 <tr class="gradeA">
463 <td class="center">42</td>
464 <td>Presto</td>
465 <td>Nokia N800</td>
466 <td>N800</td>
467 <td class="center">-</td>
468 <td class="center">A</td>
469 <td class="center">42</td>
470 </tr>
471 <tr class="gradeA">
472 <td class="center">43</td>
473 <td>Presto</td>
474 <td>Nintendo DS browser</td>
475 <td>Nintendo DS</td>
476 <td class="center">8.5</td>
477 <td class="center">C/A</td>
478 <td class="center">43</td>
479 </tr>
480 <tr class="gradeC">
481 <td class="center">44</td>
482 <td>KHTML</td>
483 <td>Konqureror 3.1</td>
484 <td>KDE 3.1</td>
485 <td class="center">3.1</td>
486 <td class="center">C</td>
487 <td class="center">44</td>
488 </tr>
489 <tr class="gradeA">
490 <td class="center">45</td>
491 <td>KHTML</td>
492 <td>Konqureror 3.3</td>
493 <td>KDE 3.3</td>
494 <td class="center">3.3</td>
495 <td class="center">A</td>
496 <td class="center">45</td>
497 </tr>
498 <tr class="gradeA">
499 <td class="center">46</td>
500 <td>KHTML</td>
501 <td>Konqureror 3.5</td>
502 <td>KDE 3.5</td>
503 <td class="center">3.5</td>
504 <td class="center">A</td>
505 <td class="center">46</td>
506 </tr>
507 <tr class="gradeX">
508 <td class="center">47</td>
509 <td>Tasman</td>
510 <td>Internet Explorer 4.5</td>
511 <td>Mac OS 8-9</td>
512 <td class="center">-</td>
513 <td class="center">X</td>
514 <td class="center">47</td>
515 </tr>
516 <tr class="gradeC">
517 <td class="center">48</td>
518 <td>Tasman</td>
519 <td>Internet Explorer 5.1</td>
520 <td>Mac OS 7.6-9</td>
521 <td class="center">1</td>
522 <td class="center">C</td>
523 <td class="center">48</td>
524 </tr>
525 <tr class="gradeC">
526 <td class="center">49</td>
527 <td>Tasman</td>
528 <td>Internet Explorer 5.2</td>
529 <td>Mac OS 8-X</td>
530 <td class="center">1</td>
531 <td class="center">C</td>
532 <td class="center">49</td>
533 </tr>
534 <tr class="gradeA">
535 <td class="center">50</td>
536 <td>Misc</td>
537 <td>NetFront 3.1</td>
538 <td>Embedded devices</td>
539 <td class="center">-</td>
540 <td class="center">C</td>
541 <td class="center">50</td>
542 </tr>
543 <tr class="gradeA">
544 <td class="center">51</td>
545 <td>Misc</td>
546 <td>NetFront 3.4</td>
547 <td>Embedded devices</td>
548 <td class="center">-</td>
549 <td class="center">A</td>
550 <td class="center">51</td>
551 </tr>
552 <tr class="gradeX">
553 <td class="center">52</td>
554 <td>Misc</td>
555 <td>Dillo 0.8</td>
556 <td>Embedded devices</td>
557 <td class="center">-</td>
558 <td class="center">X</td>
559 <td class="center">52</td>
560 </tr>
561 <tr class="gradeX">
562 <td class="center">53</td>
563 <td>Misc</td>
564 <td>Links</td>
565 <td>Text only</td>
566 <td class="center">-</td>
567 <td class="center">X</td>
568 <td class="center">53</td>
569 </tr>
570 <tr class="gradeX">
571 <td class="center">54</td>
572 <td>Misc</td>
573 <td>Lynx</td>
574 <td>Text only</td>
575 <td class="center">-</td>
576 <td class="center">X</td>
577 <td class="center">54</td>
578 </tr>
579 <tr class="gradeC">
580 <td class="center">55</td>
581 <td>Misc</td>
582 <td>IE Mobile</td>
583 <td>Windows Mobile 6</td>
584 <td class="center">-</td>
585 <td class="center">C</td>
586 <td class="center">55</td>
587 </tr>
588 <tr class="gradeC">
589 <td class="center">56</td>
590 <td>Misc</td>
591 <td>PSP browser</td>
592 <td>PSP</td>
593 <td class="center">-</td>
594 <td class="center">C</td>
595 <td class="center">56</td>
596 </tr>
597 <tr class="gradeU">
598 <td class="center">57</td>
599 <td>Other browsers</td>
600 <td>All others</td>
601 <td>-</td>
602 <td class="center">-</td>
603 <td class="center">U</td>
604 <td class="center">57</td>
605 </tr>
606 </tbody>
607 </table>
608 </div>
609 <div class="spacer"></div>
610
611
612 <h1>Initialisation code</h1>
613 <pre>$(document).ready( function () {
614 var oTable = $('#example').dataTable( {
615 "sScrollX": "100%",
616 "sScrollXInner": "150%",
617 "bScrollCollapse": true,
618 "fnDrawCallback": function ( oSettings ) {
619 /* Need to redo the counters if filtered or sorted */
620 if ( oSettings.bSorted || oSettings.bFiltered ) {
621 for ( var i=0, iLen=oSettings.aiDisplay.length ; i&lt;iLen ; i++ ) {
622 this.fnUpdate( i+1, oSettings.aiDisplay[i], 0, false, false );
623 this.fnUpdate( i+1, oSettings.aiDisplay[i], 6, false, false );
624 }
625 }
626 },
627 "aoColumnDefs": [
628 { "bSortable": false, "sClass": "indexLeft", "aTargets": [ 0 ] },
629 { "bSortable": false, "sClass": "indexRight", "aTargets": [ -1 ] }
630 ],
631 "aaSorting": [[ 1, 'asc' ]]
632 } );
633
634 new FixedColumns( oTable, {
635 "iLeftColumns": 1,
636 "iRightColumns": 1
637 } );
638 } );</pre>
639
640
641 <h1>Documentation</h1>
642 <ul>
643 <li><a href="http://datatables.net/extras/fixedcolumns">Usage</a></li>
644 <li><a href="http://datatables.net/docs/FixedColumns">API / parameters</a></li>
645 </ul>
646
647 <h1>Basic examples</h1>
648 <ul>
649 <li><a href="index.html">Basic demo of FixedColumns with zero initialisation</a></li>
650 <li><a href="left_right_columns.html">Fix the left and right columns in place</a></li>
651 <li><a href="index_column.html">Index column attached to side of the table</a></li>
652 <li><a href="x_y_scrolling.html">Index column, but with Y scrolling and no pagination</a></li>
653 <li><a href="two_columns.html">Two columns fixed in place</a></li>
654 <li><a href="right_column.html">Fix the right column in place</a></li>
655 <li><a href="css_size.html">Speeding up row height matching with CSS</a></li>
656 <li><a href="themed.html">jQuery UI themed table with FixedColumns</a></li>
657 </ul>
658
659 <h1>Advanced examples</h1>
660 <ul>
661 <li><a href="rowspan.html">Using ROWSPAN with FixedColumns</a></li>
662 <li><a href="server-side-processing.html">Server-side processing with FixedColumns</a></li>
663 <li><a href="col_filter.html">Individual column filtering</a></li>
664 <li><a href="scale_fixed.html">Setting the fixed column width and resizing the table</a></li>
665 <li><a href="scale_relative.html">Setting the fixed column width with relative sizing</a></li>
666 <li><a href="row_grouping_height.html">Row grouping by grouping like rows in the fixed column</a></li>
667 <li><a href="row_grouping.html">Row grouping by inserting a grouping row</a></li>
668 <ul>
669
670
671 <div id="footer" style="text-align:center;">
672 <span style="font-size:10px;">
673 FixedColumns and DataTables &copy; Allan Jardine 2011.<br>
674 </span>
675 </div>
676 </div>
677 </body>
678 </html>