3
我一直在努力解决CSS问题,但我似乎无法取得任何进展。使用Bootstrap响应式表格和AngularJS修复了第一列
基本上,我有一个水平滚动表,我使用了Bootstrap响应表,并且只是移除了媒体查询,以便在所有屏幕尺寸下水平滚动。我正在使用Angular的ng-repeat来遍历应用于这些标题的标题和数据数组,并且我希望第一列能够被粘住。我的HTML如下:
<div id="table" class="table-responsive">
<table class="table table-bordered">
<tr>
<th ng-repeat="header in tableHeaders" ng-show="header.show" ng-class="'column-' + $index">
<a ng-click="sortThis(header.name, $index)">
<span class="glyphicon glyphicon-chevron-down" aria-hidden="true" ng-show="sortParam !== header.name"></span>
<span class="glyphicon glyphicon-chevron-" aria-hidden="true" ng-show="sortParam === header.name"></span>
</a> {{header.name}}
<span ng-show="!$first">
<a ng-click="toggleColumn(header, $index)">X</a>
</span>
</th>
</tr>
<tr ng-repeat="row in tableData track by $index">
<td ng-repeat="point in row | orderObjectBy:tableSort track by $index" ng-show="point.show" ng-class="'column-' + $index">{{point.name}}</td>
</tr>
</table>
</div>
我有水平滚动的表,我想冻结第一列。现在,如果有帮助的话,每一列都有自己的类。有任何想法吗?
我也在做一个指令来做到这一点,并发现这个jQuery示例很有用[链接](http://stackoverflow.com/questions/19737306/bootstrap-3-responsive-table-with-fixed-first -柱)。该指令作为一个属性应用于表元素,并且不需要列上的特殊类/属性。 – softweave 2015-02-19 20:45:40