I have a table of the following format when i m trying to fix its head using the following css, I m losing the alignment , the table header and body are not getting aligned properly..What can I do to overcome this..
#ex_table { table-layout: fixed !important; } #ex_table thead tr { position: fixed !important; } Here is the HTML part
<div class="table_div" style="height:400px;width:98%;overflow:scroll"> <table id="ex_table"> /*thead and tbody populated dynamically via jquery datatables*/ <tfoot id="ex_footer"> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </tfoot> </table> </div>