1
我有我的HTML表中的問題...我想有一個滾動條時,我的表是太寬的頁面。我希望第一列在用戶水平滾動時保持固定。它有效,但表格的第二列出現在第一列的後面!它看起來像來自style="position: fixed"
屬性。第二列是後面的(固定的)第一個
下面的代碼:
<table id="coverageMatrix">
<!-- Table Headings -->
<tr>
<th class="center" style="background: #ddd; position: fixed">ertertert</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
<th class="center " style="background: #ddd;">azeazeaze</th>
</tr>
<tr name="scenarioRaws">
<th style="position: fixed">qsdqsd</th>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
</tr>
<tr name="scenarioRaws">
<th style="position: fixed">qsdqsd</th>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
</tr>
<tr name="scenarioRaws">
<th style="position: fixed">qsdqsd</th>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
<td>toto</td>
</tr>
</table>
這是它應該如何表現 – Armin
好吧,但是我怎麼獲得第二列後是固定的而不是後面?的 – Papple
可能重複:http://stackoverflow.com/questions/1312236/how-do-i-create-an-html-table-with-fixed-frozen-left-column-and-scrollable-body的 –