fixed table header using jQuery

fixed table header using jQuery

Hi,

I am trying to create fixed header for my table. I know we can use using simple CSS but i want to use using jQuery.

I am trying to follow some code found in net and the problem i am facing is when i scroll to the top of the page the header is getting attached to top of page and two headers are getting displayed.

Here is the bin


Could any one please help me with this