【问题标题】:Vertical Scrollbar to Table垂直滚动条到表格
【发布时间】: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


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2017-08-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-08
      相关资源
      最近更新 更多