0
私はトップに自分のヘッダーをスクロールダウンさせようとしています。私はCSSを使用して、以下のコードを試みたが、失敗しました。 これを行う方法を提案してください。CSS - 純粋なCSSを使用してスクロールすることから、HTMLテーブルの上にヘッダーをフリーズすることはできますか?
マイコード:
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>");
私はすべてのヘルプは本当に事前にappreciated.Thanksされ、数週間のためにこれで立ち往生しています。
使用 '位置:固定;' CSS – Poonam
に別のテーブルのヘッダを置きます。 – Gerard
[この回答を見てください](http://stackoverflow.com/a/19559747/1434964) –