<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.js">
</script>
<style>
.bg{
width:430px;
overflow-x: scroll;
position: relative;
}
#table2{
display: block;
background-color: #dedede;
position: absolute;
left:0;
top:0;
}
#table2 thead{
display:block;
}
#table1{
height: 380px;
overflow-y: scroll;
display: block;
}
</style>
</head>
<body>
<div class="bg" style="">
<table id="table2" border="1px">
<thead>
<tr>
<th>序号</th>
<th>sdfsdgsgsdg</th>
<th>dfgccccccccccccccc</th>
<th>tghrthrhrhh</th>
<th>yyyyccccccccc</th>
</tr>
</thead>
</table>
<table id="table1" border="1px">
<thead>
<tr>
<th>序号</th>
拖动滚动条,保持表头固定的HTML写法
最新推荐文章于 2022-03-24 11:38:00 发布