5 <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
6 <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
8 <title>ColReorder example - Predefined column ordering</title>
9 <link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
10 <link rel="stylesheet" type="text/css" href="../css/dataTables.colReorder.css">
11 <link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
12 <link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
13 <style type="text/css" class="init">
16 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
17 <script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
18 <script type="text/javascript" language="javascript" src="../js/dataTables.colReorder.js"></script>
19 <script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
20 <script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
21 <script type="text/javascript" language="javascript" class="init">
25 $(document).ready(function() {
26 $('#example').dataTable( {
29 order: [ 4, 3, 2, 1, 0, 5 ]
39 <body class="dt-example">
40 <div class="container">
42 <h1>ColReorder example <span>Predefined column ordering</span></h1>
45 <p>ColReorder provides the ability to specify a column ordering which is not that of the HTML (which typically you will want) through the parameter
46 <code>colReorder.order</code>. This is an array of integers with the column ordering you want.</p>
48 <p>For full information about the ColReorder options, please refer to the <a href="//datatables.net/extensions/colreorder/options">ColReorder options
49 documentation</a>.</p>
52 <table id="example" class="display" cellspacing="0" width="100%">
78 <td>System Architect</td>
85 <td>Garrett Winters</td>
94 <td>Junior Technical Author</td>
95 <td>San Francisco</td>
101 <td>Cedric Kelly</td>
102 <td>Senior Javascript Developer</td>
117 <td>Brielle Williamson</td>
118 <td>Integration Specialist</td>
125 <td>Herrod Chandler</td>
126 <td>Sales Assistant</td>
127 <td>San Francisco</td>
133 <td>Rhona Davidson</td>
134 <td>Integration Specialist</td>
141 <td>Colleen Hurst</td>
142 <td>Javascript Developer</td>
143 <td>San Francisco</td>
150 <td>Software Engineer</td>
158 <td>Office Manager</td>
166 <td>Support Lead</td>
173 <td>Charde Marshall</td>
174 <td>Regional Director</td>
175 <td>San Francisco</td>
181 <td>Haley Kennedy</td>
182 <td>Senior Marketing Designer</td>
189 <td>Tatyana Fitzpatrick</td>
190 <td>Regional Director</td>
197 <td>Michael Silva</td>
198 <td>Marketing Designer</td>
206 <td>Chief Financial Officer (CFO)</td>
213 <td>Gloria Little</td>
214 <td>Systems Administrator</td>
221 <td>Bradley Greer</td>
222 <td>Software Engineer</td>
230 <td>Personnel Lead</td>
237 <td>Jenette Caldwell</td>
238 <td>Development Lead</td>
246 <td>Chief Marketing Officer (CMO)</td>
253 <td>Caesar Vance</td>
254 <td>Pre-Sales Support</td>
261 <td>Doris Wilder</td>
262 <td>Sales Assistant</td>
269 <td>Angelica Ramos</td>
270 <td>Chief Executive Officer (CEO)</td>
285 <td>Jennifer Chang</td>
286 <td>Regional Director</td>
293 <td>Brenden Wagner</td>
294 <td>Software Engineer</td>
295 <td>San Francisco</td>
302 <td>Chief Operating Officer (COO)</td>
303 <td>San Francisco</td>
310 <td>Regional Marketing</td>
317 <td>Michelle House</td>
318 <td>Integration Specialist</td>
333 <td>Prescott Bartlett</td>
334 <td>Technical Author</td>
341 <td>Gavin Cortez</td>
343 <td>San Francisco</td>
349 <td>Martena Mccray</td>
350 <td>Post-Sales support</td>
357 <td>Unity Butler</td>
358 <td>Marketing Designer</td>
359 <td>San Francisco</td>
365 <td>Howard Hatfield</td>
366 <td>Office Manager</td>
367 <td>San Francisco</td>
373 <td>Hope Fuentes</td>
375 <td>San Francisco</td>
381 <td>Vivian Harrell</td>
382 <td>Financial Controller</td>
383 <td>San Francisco</td>
389 <td>Timothy Mooney</td>
390 <td>Office Manager</td>
397 <td>Jackson Bradshaw</td>
405 <td>Olivia Liang</td>
406 <td>Support Engineer</td>
414 <td>Software Engineer</td>
421 <td>Sakura Yamamoto</td>
422 <td>Support Engineer</td>
437 <td>Finn Camacho</td>
438 <td>Support Engineer</td>
439 <td>San Francisco</td>
445 <td>Serge Baldwin</td>
446 <td>Data Coordinator</td>
453 <td>Zenaida Frank</td>
454 <td>Software Engineer</td>
461 <td>Zorita Serrano</td>
462 <td>Software Engineer</td>
463 <td>San Francisco</td>
469 <td>Jennifer Acosta</td>
470 <td>Junior Javascript Developer</td>
477 <td>Cara Stevens</td>
478 <td>Sales Assistant</td>
485 <td>Hermione Butler</td>
486 <td>Regional Director</td>
494 <td>Systems Administrator</td>
501 <td>Jonas Alexander</td>
503 <td>San Francisco</td>
510 <td>Regional Director</td>
517 <td>Michael Bruce</td>
518 <td>Javascript Developer</td>
525 <td>Donna Snider</td>
526 <td>Customer Support</td>
536 <li class="active">Javascript</li>
540 <li>Server-side script</li>
545 <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
546 $('#example').dataTable( {
549 order: [ 4, 3, 2, 1, 0, 5 ]
554 <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
557 <li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
558 <li><a href="../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
559 <li><a href="../js/dataTables.colReorder.js">../js/dataTables.colReorder.js</a></li>
564 <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
569 <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
570 additional CSS used is shown below:</p><code class="multiline language-css"></code>
573 <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
576 <li><a href="../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
577 <li><a href="../css/dataTables.colReorder.css">../css/dataTables.colReorder.css</a></li>
582 <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
587 <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
588 processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
589 documentation</a>.</p>
597 <div class="gradient"></div>
600 <h2>Other examples</h2>
603 <div class="toc-group">
604 <h3><a href="./index.html">Examples</a></h3>
605 <ul class="toc active">
606 <li><a href="./simple.html">Basic initialisation</a></li>
607 <li><a href="./new_init.html">Initialisation using `new`</a></li>
608 <li><a href="./alt_insert.html">Alternative insert styling</a></li>
609 <li><a href="./realtime.html">Realtime updating</a></li>
610 <li><a href="./state_save.html">State saving</a></li>
611 <li><a href="./scrolling.html">Scrolling table</a></li>
612 <li class="active"><a href="./predefined.html">Predefined column ordering</a></li>
613 <li><a href="./reset.html">Reset ordering API</a></li>
614 <li><a href="./colvis.html">ColVis integration</a></li>
615 <li><a href="./fixedcolumns.html">FixedColumns integration</a></li>
616 <li><a href="./fixedheader.html">FixedHeader integration</a></li>
617 <li><a href="./jqueryui.html">jQuery UI styling</a></li>
618 <li><a href="./col_filter.html">Individual column filtering</a></li>
619 <li><a href="./server_side.html">Server-side processing</a></li>
624 <div class="epilogue">
625 <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
626 Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and <a href="http://www.datatables.net/plug-ins">plug-ins</a>
627 which extend the capabilities of DataTables.</p>
629 <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2015<br>
630 DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>