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的 –