0

Can anybody help me with this situation? Javascript Fix Table Header

I am also having the same problem, but don't know how to fix it. Sorry for the duplicate.

Thanks

EDIT: I tried to set the fixed width on Table's all TH and TD tags. But still width of some of the TD TH are messed up. I just want to find the width using DOM and attach that width to clone table.

Community
  • 1
  • 1
user1882705
  • 1,081
  • 4
  • 15
  • 43
  • 6
    question inside question inside a question .. inception! – Ejaz Apr 11 '13 at 15:40
  • 1
    possible duplicate of [Javascript Fix Table Header](http://stackoverflow.com/questions/15931729/javascript-fix-table-header) – esqew Apr 11 '13 at 15:40

1 Answers1

0
$("table thead").css('position','absolute');

this will work

pb2q
  • 58,613
  • 19
  • 146
  • 147
deepak
  • 199
  • 2
  • 9
  • It is not that simple...My table will display the columns based on filtering option. So if i clone the table header it will display the unnecessary tH when it is not suppose to display. – user1882705 Apr 11 '13 at 16:25
  • its perfectly working on what ever mentioned in post where you have pointed. I have tried it. Here you are making your only header row as absolute position ,so while scrolling it will not move at all. Now rest of work about your page structure , source of data, I can not predict about it. You have to decide when to execute that statement. – deepak Apr 11 '13 at 18:14