2017-09-22 234 views
0

我需要添加垂直滚动条到表ID =“项目”(取决于表中的项目的高度或数量),我尝试通过添加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> 

回答

0

我想表没有财产溢出 你应该设置它在这里

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