【发布时间】:2021-03-17 02:49:39
【问题描述】:
当前问题看起来像这样 如图所示,内容滚动到页眉后面时,还是有一点点可见的。我如何解决这个问题并在粘性标题后面滚动时使内容不可见?
.tableUpdates {
overflow-y: auto;
height: 250px;
}
.tableUpdates thead th {
position: sticky;
margin-top:0px;
top: 0;
background: #DC3545;
}
<div class="col-md-4 pr-0 tableUpdates">
<table class="table table-bordered table-hover">
<thead class="bg-danger text-light">
<tr>
<th>Header</th>
</tr>
</thead>
<tbody>
.....some rows
</tbody>
</table>
</div>
【问题讨论】:
-
可以在通用选择器中添加0的边距和内边距
-
@ShayanKanwal 在添加 0 的边距和填充后问题仍然存在。
标签: html css bootstrap-4 html-table scrollable