need to add these two files

http://cdn.datatables.net/fixedheader/2.1.1/css/dataTables.fixedHeader.css
http://cdn.datatables.net/fixedheader/2.1.1/js/dataTables.fixedHeader.min.js

and this

var table = jQuery('#datatable').dataTable({});
new $.fn.dataTable.FixedHeader( table, {
    // alwaysCloneTop: true
    // "zTop": "2001"
    "offsetTop": 50
});

You can check more options here.

Advertisements