gpt4 book ai didi

jquery - 在 html 表格中卡住标题

转载 作者:太空宇宙 更新时间:2023-11-04 04:12:54 24 4
gpt4 key购买 nike

在这里,我有一个表,我想在滚动时修复该表头

JS

<script>
$('#scroll').scroll(function(){
if ($('#scroll').scrollTop() > 10){
$("thead").css({
position: 'fixed',
top: '68px'
});
}else{
$('thead').css({
position: 'static'
});
}
});
</script>

这是完美的,但设计正在改变。

LIVE DEMO

谁能帮帮我。

提前致谢。

编辑

Fiddle

最佳答案

您可以使用 datatables plugin具有不同的表类型(fixed header table, example)

关于jquery - 在 html 表格中卡住标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20392574/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com