黏贴在广告上

黏贴在广告上,第1张

黏贴在广告上

在2018 年的 工作日上保持 粘性

样式表中,只需添加以下一行:

thead th { position: sticky; top: 0; }

您的表将需要包含 theadth 才能进行样式设置。

<table>    <thead>        <tr> <th>column 1</th> <th>column 2</th> <th>column 3</th> <th>column 4</th>         </tr>        </thead>    <tbody>      // your body pre    </tbody></table>

另外,如果 thead中 有多行,则可以选择第一个保持粘性:

thead tr:first-child th { position: sticky; top: 0; }


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5061542.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-15
下一篇2022-11-15

发表评论

登录后才能评论

评论列表(0条)

    保存