固定位置在這裏沒有幫助可能是我做錯了什麼。固定表頂部一排
第一行中的輸入框在滾動時應保持凍結狀態。我知道這已被回答,但沒有任何解決方案正在工作。
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>
這樣的事情? http://jsfiddle.net/peteng/r8WDb/3/ – Pete
你的CSS標記是錯誤的。你不能嵌套你的CSS('.table {.. table {..} ..}) – putvande
行的類main_tr超出了表的範圍@Pete – roshan