首页 > 解决方案 > 如何使用 Angular 2 在 ng2-smart-table 中为表体应用滚动

问题描述

我正在使用具有 19 列的 ng2-smart-table,它超出了仪表板的框架。所以我需要将水平滚动应用于表格主体。

我在我的 Angular 2 项目中使用 ng2-smart-table

:host /deep/ table {
  width: 1200px !important;
  overflow-x: scroll;

}

我没有得到表格的水平滚动

标签: scrollbarvertical-scrollingng2-smart-table

解决方案


试试这个代码:

<div class="col-md-12" style = "overflow-x: scroll;">
     <div class="smart-table-container" style = "width: 2000px;">
          <ng2-smart-table [settings]="settings" [source]="source"></ng2-smart-table>  
     </div>
 </div>

推荐阅读