ColReorder provides the ability to specify a column ordering which is not that of the HTML (which typically you will want) through the parameter colReorder.order
. This is an array of
integers with the column ordering you want.
Start date | Age | Office | Position | Name | Salary |
---|---|---|---|---|---|
2008/11/28 | 33 | Tokyo | Accountant | Airi Satou | $162,700 |
2009/10/09 | 47 | London | Chief Executive Officer (CEO) | Angelica Ramos | $1,200,000 |
2009/01/12 | 66 | San Francisco | Junior Technical Author | Ashton Cox | $86,000 |
2012/10/13 | 41 | London | Software Engineer | Bradley Greer | $132,000 |
2011/06/07 | 28 | San Francisco | Software Engineer | Brenden Wagner | $206,850 |
2012/12/02 | 61 | New York | Integration Specialist | Brielle Williamson | $372,000 |
2011/05/03 | 38 | London | Software Engineer | Bruno Nash | $163,500 |
2011/12/12 | 21 | New York | Pre-Sales Support | Caesar Vance | $106,450 |
2011/12/06 | 46 | New York | Sales Assistant | Cara Stevens | $145,600 |
2012/03/29 | 22 | Edinburgh | Senior Javascript Developer | Cedric Kelly | $433,060 |
Start date | Age | Office | Position | Name | Salary |
The Javascript shown below is used to initialise the table shown in this example:
1 2 3 4 5 6 7 | $(document).ready( function () { $( '#example' ).dataTable( { colReorder: { order: [ 4, 3, 2, 1, 0, 5 ] } } ); } ); |
In addition to the above code, the following Javascript library files are loaded for use in this example: