我使用angular-6-datatable如下所示,这里我想添加一些与样式相关的功能。
overflow-y : auto
)。https://stackblitz.com/edit/angular-swegc6?file=src%2Fapp%2Fapp.component.ts
我尝试过的:
我从https://codepen.io/yavuzselim/pen/LNYrBd尝试了这种造型,但它没有按预期工作。
这是表的css
table{
display: block;
width: 100%;
background-color: #f3f3f3;
thead { background:#ff5500}
thead,tbody , tr{
width: 100%;
display:block;
overflow: auto;
}
th,td {
display: inline-block;
overflow: hidden;
}
}
这个你可以如何设置tbody的高度
<tbody [ngStyle]="{'height':(mf?.data?.length > 5) ? '200px' : 'auto'}">
global style.scss
ul:first-of-type:not(.pull-right) {
li {
display: none;
}
li:first-of-type , li:last-of-type{
display: inline-block;
}
}
这个例子我使用
scss