【发布时间】:2018-03-03 16:11:27
【问题描述】:
我需要将垂直滚动条添加到表格 ID="items"(取决于高度或表格中的项目数),我尝试通过添加 style="height:200px;Overflow:auto" 但由于 ng-repeat,滚动条被添加到单独的行而不是完整的表格中。有人可以帮我吗?
<div class="col-md-12" style="padding-top:10px" ng-show="itemCodesExists.length > 0">
<div class="col-md-12">
<table border="1">
<tr>
<th style="width:100px;text-align:center">ItemCode</th>
<th style="width:100px;text-align:center">ItemDescription</th>
<th style="width:100px;text-align:center">ItemQuantity</th>
</tr>
</table>
<div ng-repeat="item in itemCodesExists">
<table id="items" style="overflow-y:auto" border="1">
<tr style="text-align:center">
<td style="width:100px">{{item.ItemCode}}</td>
<td style="width:120px">{{item.Description}}</td>
<td style="width:100px">{{item.Quantity}}</td>
</tr>
</table>
</div>
</div>
</div>
【问题讨论】:
标签: html angularjs html-table scrollbar