jquery - Fixing multiple column in dataTable -


i using datatables 1.10.0 , need fix columns of table in image.

datatable fixed column

as in datatables documentation table fixedcolumns, have tried following code:

$(document).ready(function () {     var table = $('#mytable').datatable({         "idisplaylength": 10,         "ordering": false,         "scrolly": "300px",         "scrollx": "100%",         "scrollcollapse": true,     });     new $.fn.datatable.fixedcolumns( table ); });  

this fixes s.no. column table in image. how can fix first 3 columns left, particular case s.no., action , status. appreciated. thanks.

use leftcolumns parameter. see multiple fixed columns example in documentation.

new $.fn.datatable.fixedcolumns( table, {     leftcolumns: 3 } ); 

Comments