I am using jquery floatThead
http://mkoryak.imtqy.com/floatThead/#intro
I had to use a bit of jquery to convert the first line to thead to make it work.
example below:
$(document).ready(function () { var $theadCols = $("#ContentPlaceHolder1_grdCashflow tr:first-child"), $table = $("#ContentPlaceHolder1_grdCashflow"); // create thead and append <th> columns $table.prepend("<thead/>"); $table.find("thead").append($theadCols); // init stickyHeader $table.floatThead(); //$table = $("#ContentPlaceHolder1_grdCashflow"); $table.dataTable( { "paging": false, "ordering": false, "dom":'<"top"fi>rt<"bottom"><"clear">' } ); });
source share