我在div中放置了一个网格视图,滚动条就在那里。我想固定网格视图标题,而滚动时只有内容可滚动。 怎么能这样.... 在此先感谢....
答案 0 :(得分:1)
尝试执行以下操作。
隐藏标题 配置div,所以你有侧栏 在div上添加另一个div,列名为
不要忘记修改列大小,并使它们与顶部的列名相同。
答案 1 :(得分:1)
在gridview绑定后的C#中 GVBrand.HeaderRow.TableSection = TableRowSection.TableHeader;
在gridview中添加以下css
table {
width: 100%;
}
thead, tbody, tr, td, th { display: block; }
tr:after {
content: ' ';
display: block;
visibility: hidden;
clear: both;
}
thead th {
height: 30px;
/*text-align: left;*/
}
tbody {
height: 120px;
overflow-y: auto;
}
thead {
/* fallback */
}
tbody td, thead th {
width: 19.2%;
float: left;
}
答案 2 :(得分:0)