我是webDevelopment.
的新手在发布之前,我已经经历了所有的答案,但是他们都没有为我工作。所以,我在问这个问题。我有一张桌子,我添加了修复标题在响应表中angularjs
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' – devqon
因为在ng-repeat中表格是有超过100个条目,所以我只想为该表添加一个滚动条。因此,我希望标题应该被修复。 – ganeshk
不能使用溢出-y:在tbody上滚动 – ganeshk