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
/*thead and tbody populated dynamically via jquery datatables*/
解决方案
You got to set width to your cells strictly:
th, td {
width:30px
}