我是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