如何在Angular Dialog窗口中制作滚动div

时间:2018-01-23 09:19:04

标签: html css html5

我想在对话框中执行类似图表的操作。问题是图表很长,对话框只有800像素。我试图在底部做一个滚动,它将支持div并将其向左和向右移动,但不是在一行中创建图形,而是在对话框中创建下一行并在右侧添加滚动。

代码:

<mat-dialog-content>
    <div class="table">
      <div class="columns" *ngFor="let obj of getArray(); let i = index"
                     index="{{i}}" value="{{obj}}"></div>
    </div>
  </mat-dialog-content>

css:

columns {
  display: inline-block;

}

.table {
  min-height: 700px;
  height: 400px;
  overflow-x: scroll;
}

1 个答案:

答案 0 :(得分:1)

尝试添加到您的css max-height,当您的内容高度超过div时,scroll-x必须正常工作