[英]Always display text in high table cells on top when scrolling
我找到了解決方案。 首先,您必須將組標簽放入 '' 元素中。 然后添加引導程序的'sticky-top' class,或以下屬性:
.sticky-top {
position: -webkit-sticky;
position: sticky;
top: 0;
}
一個例子是:
<table>
<tr>
<th rowspan="2">
<span class="sticky-top">Group</span>
</th>
<td>Detail</td>
</tr>
<tr>
<td>Detail</td>
</tr>
</table>
使用“位置:粘性;” 可以幫助你,我猜。
div.sticky { position: -webkit-sticky; /* Safari */ position: sticky; top: 0; }
<div> <div class="sticky">Im sticky!</div> </div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.