【发布时间】:2017-07-26 11:05:01
【问题描述】:
我是webDevelopment. 的新手,在发布此之前,我已经阅读了所有答案,但没有一个对我有用。所以,我在问这个问题。我有一张桌子,我在其中添加了
overflow-y:scroll;
height:100px;
使用这个我得到滚动条,但我的表格标题不固定。那么,有人可以帮我解决这个问题吗?
<div class="col-xs-12 col-md-12 nopadding">
<div class="table-responsive">
<table class="table table-striped table-bordered col-xs-12 col-lg-12">
<thead class="text-center text-info text-capitalize">
<th class="text-center">Sr.No.</th>
<th class="text-center">Document</th>
<th class="text-center">Score</th>
<th class="text-center">Actions</th>
</thead>
<tr ng-repeat="file in processResumeFiles">
<td class="text-center">{{ file.id}}</td>
<td class="view-orphan uploadResumeTableCellOverFlow">
{{ file.attributes.name}}
</td>
<td class="text-center">{{file.totalScore}}</td>
<td class="text-center">
<button class="btn btn-labeled btn-info" title="click to see" ng-disabled="!file.attributes.isUploadedDocument" data-ng-click="somemethod($index)">
<i class="fa fa-eye" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="click to see" ng-disabled="!file.attributes.isCommitted || !file.attributes.isUploadedDocument" data-ng-click="somemethod(file.attributes.name)">
<i class="fa fa-share" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="click to see" data-ng-click="somemethod(file.attributes.name)">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="click to see" ng-disabled="!file.attributes.isCommitted || !file.attributes.isUploadedDocument" data-ng-click="somemethod(file.attributes.name)">
<i class="fa fa-sign-out" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="click to see" ng-disabled="!file.attributes.isCommitted || !isjdDeleted || !jdSelected"
data-ng-click="somemethod(file.attributes.name)">
<i class="fa fa-check-square" aria-hidden="true"></i>
</button>
</td>
</tr>
</table>
</div>
</div>
【问题讨论】:
-
您为什么希望它们得到修复?您可以做的只是在
tbody上设置overflow-y: scroll;而不是表格元素,但这需要将元素显示为block -
因为在 ng-repeat 表中有超过 100 个条目,所以我只想为该表添加一个滚动条。正因为如此,我希望标题应该是固定的。
-
无法在 tbody 上使用 overflow-y:scroll
-
正如我所说,您还需要
display: block,但这会造成很大的伤害 -
试过..但它只是移动标题的位置。
标签: javascript jquery html css angularjs