1
HTML
<html>
<body>
<div style="width:100%; height: 300px; overflow: auto;">
<table cellspacing="0" cellpadding="2" style="width:100%;">
<thead>
<tr>
<td>Col1</td>
<td>Col2</td>
<td>Col3</td>
<td>Col4</td>
</tr>
</thead>
<tbody tabindex="0">
<tr>
<td>Col1</td>
<td>Col2</td>
<td>Col3</td>
<td>Col4</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
問題
在Firefox中,當你點擊一排,它把聚焦到TBODY,導致含div來產生一個水平滾動條,其滾動爲1個像素。問題
如何防止單擊行時顯示的水平滾動?我可以將"overflow-x: hidden; overflow-y: auto;"
放在包含div的div上,但是如果div確實需要水平滾動,該怎麼辦?有誰知道更好的方法來處理這個問題嗎?
謝謝!這工作。 – 2009-11-09 20:33:56