在这里,我有一个表,我想在滚动时修复该表头
JS
<script>
$('#scroll').scroll(function(){
if ($('#scroll').scrollTop() > 10){
$("thead").css({
position: 'fixed',
top: '68px'
});
}else{
$('thead').css({
position: 'static'
});
}
});
</script>
这是完美的,但设计正在改变。
谁能帮帮我。
提前致谢。
编辑
最佳答案
您可以使用 datatables plugin具有不同的表类型(fixed header table, example)
关于jquery - 在 html 表格中卡住标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20392574/