核心代码:
设置thead样式
position: sticky;
top: 0px;
z-index: 1;
参考代码:
<style>
table thead th
{font-weight:bold !important;
}
</style>
<table>
<thead style="position:sticky;top: 0px; z-index: 1;">
<tr style=" background: #9efeff; ">
<th >序号</th>
<th >姓名</th>
<th >员工编号</th>
<th >部门</th>
<th >院网</th>
<th >小计</th>
<th >分公司</th>
</tr>
</thead>
<tbody>
</tbody>
</table>