How get header of the table fixed while the table data is scrolling down via jquery ! the height of the table fixed
<html>
<body>
<style type="text/css">
<table class="fx">
<tbody>
<tr>
<th>Email ID</th>
<th>Time Taken to complete game (secs)</th>
<th>Email ID</th><th>Time Taken to complete game (secs)</th>
</tr>
</tbody>
</table>
</div>
<table class="data">
<tbody>
<tr>
<td>asd@gmail.com</td>
<td>449</td>
<td>asd@gmail.com</td>
<td>449</td>
</tr>
<tr>
<tr>
<td>sad@gmail.com</td>
<td>449</td><td>asd@gmail.com</td>
<td>449</td>
</tr>
<tr>
<tr>
<td>as@gmail.com</td>
<td>449</td>
<td>asd@gmail.com</td>
<td>449</td>
</tr>
<tr>
</tr>
</tbody>
</table>
table tbody
{
display: block;
height: 262px;
overflow: auto;
}
table {
table-layout: fixed;
height: 100px;
overflow: auto;
padding: 10px;
}
table tr{
background-color: #F5F5F5;
}
table tr:nth-child(odd){
background-color: #eee;
}
table tr:nth-child(even){
background-color: #F5F5F5;
}
table tr td{
padding:10px;
width: 200px;
max-width: 200px;
word-wrap:break-word;
height: auto;
text-align: center;
color:#5d8d5d;
}
.fx{
position: fixed;
top: 0;
left: 0;
}
.fx tr th {
padding:10px;
background-color: #ddd;
width: 200px;
color:#6d4d9d;
text-align: center;
}
.data{
margin-top: 70px;
}
div{
position: relative;
}
*{
margin: 0;
padding: 0;
}
</style>
<div>
</body>
</html>
How get header of the table fixed while the table data is scrolling down via jquery ! the height of the table need urgently