垂直滚动条到表格

时间:2017-09-22 06:59:35

标签: html angularjs html-table scrollbar

我需要将垂直滚动条添加到表ID =“items”(取决于表中的项目的高度或数量),我尝试添加style =“height:200px;溢出:自动”但由于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>

1 个答案:

答案 0 :(得分:0)

我认为表没有属性溢出 你应该在这里设置

<div ng-repeat="item in itemCodesExists"
style="overflow-y:auto;height:200px;">
相关问题