我在Bootstrap卡片中嵌入了数据表格,但是当表格高度超过卡片高度时,它会超出卡片范围。我在一个表格包装器上设置了overflow: auto,但是一旦超出卡片高度,它也不会触发。
以下是简化的示例: https://stackblitz.com/edit/js-bootstrap4-gbnhfx?file=style.css
以下是简化的示例: https://stackblitz.com/edit/js-bootstrap4-gbnhfx?file=style.css
我已经fork了你的stackblitz (https://stackblitz.com/edit/js-bootstrap4-tsnbuq)
我在这里使用了样式属性来简化。但是内部div是溢出的项目,然后你的外部div(你有CSS处理溢出)正在添加滚动条。
这是主要更改:
<div class="table-wrap">
<div style="height:690px">
<table class="table table-sm table-dark table-striped">
<thead>
</thead>
<tbody>
<tr>
<td>test</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="table-wrap"> <div style="height: 690px"> <table class="table table-sm table-dark table-striped">
。 - developer