<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>表头固定实例</title>
<!-- Bootstrap -->
<link href="../js/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../js/lib/jquery-3.3.1.js"></script>
<script src="../js/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<style type="text/css">
table tbody {
display: block;
height: 350px;
overflow-y: scroll;
}
table thead, tbody tr {
display: table;
width: 100%;
table-layout: fixed;
}
table thead {
width: calc(100% - 17px)
}
</style>
</head>
<body>
<div id="aa" style="width: 800px; height: 450px; margin-left: 200px; border: dashed 1px;margin-top: 50px;">
<div style="width: 700px; height: 400px; margin-left: 50px;margin-top: 20px; border: dotted 1px;">
<table class="table table-bordered">
<thead>
<tr>
<th>名称</th>
<th>作者</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
<tr>
<td>傲慢与偏见</td>
<td>简·奥斯汀</td>
<td>一部爱情片....</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
效果截图: