I have been trying to freeze my header on Top, from scrolling down. I tried the below code using css, but unsuccessful. Please suggest a way to do it.
My code:
document.write("<div align=\"left\" style=\"border:1px solid grey; float:left; overflow-y :scroll; margin-top:5px; margin-right:50px; height:410px; width:95%;\">");
document.write("<table border=1 height=100% width=100% margin-bottom:100px align=\"center\" cellspacing=0px style=\"width:350px;\">");
document.write("<thead bgcolor=\"#B8CCE5\" style=\"width:30px; \" >");
document.write("<tr style=\"display:table; width:100%; \"><th>Dates</th><th>Upgrade</th><th>Downloads</th><th nowrap width=100px>Total User Count</th></tr>");
document.write("</thead>");
document.write("<tbody style=\" display:block; max-height:365px; overflow-y:scroll; \">");
for(var i=0;i<dates.length;i++){
document.write("<tr style=\" \">");
document.write("<td nowrap align=center bgcolor=\"#DCE7EF\">"+dates[i]+"</td>");
document.write("<td nowrap align=center>"+name[i]+"</td>");
document.write("<td nowrap align=center>"+age[i]+"</td>");
document.write("<td nowrap align=center>"+count[i]+"</td>");
document.write("</tr>");
}
document.write("</tbody>");
document.write("</table>");
document.write("</div>");
I am stuck with this for weeks, Any help is really appreciated.Thanks in Advance.