弹窗表格设置高度。超过高度自动出现滚动条
可以给你外面的盒子加一点内边距 padding-bottom:10px
function filterComplaint(v) {
var rstr = '无';
if (strIsEmpty(v)) {
return '无';
} else {
rstr = '<div class="MHover">' + v + '</div>' +
'<div class="MALL">' + v + '</div>';
}
return rstr;
}
答案:
要实现表格最小高度为300px并自动出现滚动条,我们可以使用CSS的max-height和overflow属性来实现。具体步骤如下:
.table-wrapper {
max-height: 300px;
overflow: scroll;
}
<div class="table-wrapper">
<table>
<!-- 表格内容 -->
</table>
</div>
完整示例:
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>姓名</th>
<th>年龄</th>
</tr>
</thead>
<tbody>
<!-- 一些表格数据 -->
</tbody>
</table>
</div>
<style>
.table-wrapper {
max-height: 300px;
overflow: scroll;
}
</style>
参考资料: - CSS overflow 属性