【发布时间】:2015-02-07 00:27:35
【问题描述】:
我已经使用 ngtable 在 angularjs 中创建了一个应用程序,因为我需要修复表头我尝试使用 position:fixed; 来固定头部,但问题是现在身体和头部也重叠了表格没有展开
我的代码如下所示
html
<div ng-controller="IndexCtrl">
<table border="1" ng-table="mytable" id="myTable" class="ScrollArea">
<tbody ng-repeat="peop in $groups">
<tr ng-repeat="people in peop.data">
<td sortable="id" data-title="'Id'">{{people.id}}</td>
<td sortable="desig" data-title="'Desig'">{{people.desig}}</td>
<td sortable="name" data-title="'Name'">{{people.name}}</td>
<td sortable="place" data-title="'Place'">{{people.place}}</td>
</tr>
</tbody>
</table>
</div>
css
#myTable thead
{
position:fixed;
}
.ScrollArea
{
display: block;
height: 200px;
overflow-y: scroll;
}
【问题讨论】:
-
为什么不尝试使用 ui-grid(ng-grid)?ui-grid.info
-
我们正在使用 ng-table....
标签: html css angularjs html-table fixed-header-tables