[英]Informing the mat-table that it should expand to fit the mat-cells?
I've increased the width of mat-cell
elements like this:我增加了这样的
mat-cell
元素的宽度:
.mat-cell {
min-width: 8rem;
}
This causes the cells total width to expand beyond the viewport width, which in turn causes it to overflow the mat-table
.这会导致单元格的总宽度超出视口宽度,从而导致它溢出
mat-table
。
How do we get the mat-table
to dynamically increase its size to fit the cells?我们如何让
mat-table
动态增加其大小以适应单元格? Right now it looks like it only expands by default to the width of the viewport.现在看起来它默认只会扩展到视口的宽度。
This is one solution.这是一种解决方案。 It makes the table container scrollable.
它使表容器可滚动。
Add overflow: auto
;添加
overflow: auto
;
.mat-table { width: 100%; overflow: auto}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.