Re-arrange the DataTable Columns

Re-arrange the DataTable Columns. DataTable has wide range of supports and customization, you can do a lot with your HTML tables. Let’s try re arranging the columns in DataTable. For the demo purpose, i am going to make an html table and a pre data with help of that we will make the demo working one,

$('#reorder1').click(function(e){
// Pass it true so colReorder knows these are original indexes
table.colReorder.order(getNewOrder(["Position","Salary"]), true);
});
$('#reorder2').click(function(e){
// Pass it true so colReorder knows these are original indexes
table.colReorder.order(getNewOrder(["Office","Start date"]), true);
});