My code is like this : http://jsfiddle.net/oscar11/ebRXw/805/
$(document).ready(function() {
var table = $('#example').DataTable( {
"responsive": true
} );
} );
In my example:
I want to change it to be like this without changing the HTML:
SOLUTION
Use columns.data
to set data source index for each column.
var table = $('#example').DataTable( {
"responsive": true,
"columns": [
{ "data": 5 },
{ "data": 4 },
{ "data": 3 },
{ "data": 0 },
{ "data": 1 },
{ "data": 2 }
]
} );
Don't forget to adjust table headings in thead
section accordingly.
DEMO
See this jsFiddle for code and demonstration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With