Asp.net GridView固定表頭使用CSS

Asp.net GridView固定表頭使用CSS

CSS
<style>
.Freezing
{
position:relative ;
table-layout:fixed;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
.Freezing th{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:2px;}
</style>



用法:
1.GridView設定CSS如上的樣式,HeaderStyle加CssClass="Freezing"
2.包住GridView使用的Div
<div style="overflow-y: scroll; height: 200px; width: 200px;">
</div>

0 意見: