JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-lg-12">
<table class="table table-bordered table-striped">
<thead style="background:#e00000;">
<tr>
<th>Class</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code>.active</code>
</th>
<td>鼠标悬停在行或单元格上时所设置的颜色</td>
</tr>
<tr>
<th scope="row">
<code>.success</code>
</th>
<td>标识成功或积极的动作</td>
</tr>
<tr>
<th scope="row">
<code>.info</code>
</th>
<td>标识普通的提示信息或动作</td>
</tr>
<tr>
<th scope="row">
<code>.warning</code>
</th>
<td>标识警告或需要用户注意</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
<td>标识危险或潜在的带来负面影响的动作</td>
</tr>
<tr>
<th scope="row">
<code>.danger</code>
</th>
...
CSS
thead {
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: -o-sticky;
position: sticky;
top: 0;
z-index: 10;
display: table;
width: 100%;
}
tbody {
display: table;
width: 100%;
}