固定位置在这里没有帮助可能是我做错了什么。
第一行中的输入框应在滚动时保持冻结状态。我知道这已经被回答过,但没有一个解决方案有效。
http://jsfiddle.net/roshanjsachan/r8WDb/
.table{
text-align:center;
overflow: auto;
table{
width: 95%;
margin: auto;
margin-top: 5px;
}
}
.table_scroll
{
display:block;
height:500px;
overflow-y:scroll;
}
<div class="table">
<table class="table_scroll">
<tbody>
<tr class="main_tr">
<th class="input_col"><input title="empno" placeholder="empno" type="text" class="col_data" id="empno" autocomplete="off"></th>
<th class="input_col"><input title="name" placeholder="name" type="text" class="col_data" id="name" autocomplete="off"></th>
<th class="input_col"><input title="job" placeholder="job" type="text" class="col_data" id="job" autocomplete="off"></th>
<th class="input_col"><input title="boss" placeholder="boss" type="text" class="col_data" id="boss" autocomplete="off"></th>
<th class="input_col"><input title="hiredate" placeholder="hiredate" type="text" class="col_data" id="hiredate" autocomplete="off"></th>
<th class="input_col"><input title="salary" placeholder="salary" type="text" class="col_data" id="salary" autocomplete="off"></th>
<th class="input_col"><input title="comm" placeholder="comm" type="text" class="col_data" id="comm" autocomplete="off"></th>
<th class="input_col"><input title="deptno" placeholder="deptno" type="text" class="col_data" id="deptno" autocomplete="off"></th>
</tr>
<tr id="row1" class="remove table_row">
<td>7369</td>
<td>SMITH</td>
<td>CLERK</td>
<td>7902</td>
<td>1980-12-17</td>
<td>800.00</td>
<td></td>
<td>20</td>
</tr>
<tr id="row2" class="remove table_row">
<td>7370</td>
<td>ALLEN</td>
<td>CLERK</td>
<td>7902</td>
<td>1980-12-17</td>
<td>800.00</td>
<td></td>
<td>20</td>
</tr>
</tbody>
</table>
</div>