我創建了一個多重粘性頭:
.content {
margin: 0px;
text-align: center
}
.dataTable {
margin: 0px;
padding: 0px;
width: 100%;
}
.dataTable thead {
top: 36px;
}
.header {
background: #ddd;
color: #222;
margin: 0px;
position: sticky;
padding: 0.5em;
text-align: center;
}
#header01 {
margin: 0px;
top: 0;
}
.mainParent {
background: rgba(222, 222, 222, 0.10);
text-align: center;
}
.mainParent {
margin: 0em
}
<div class="mainParent">
<div class="header" id="header01">Header 01</div>
<div id="content01" class="content">
<table class="dataTable">
<thead class="header">
<tr>
<td>1</td>
</tr>
</thead>
<tbody>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
</tbody>
</table>
<table class="dataTable">
<thead class="header">
<tr>
<td>2</td>
</tr>
</thead>
<tbody>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
<tr>
<td>QQ</td>
</tr>
</tbody>
</table>
</div>
</div>