<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>
"overflow-x: hidden; overflow-y: auto;"
放在包含div上,但是如果div确实需要水平滚动呢?有没有人知道更好的方法来解决这个问题?
答案 0 :(得分:4)
如果你想阻止虚线出现,试试这个:
<style>
table *:focus{
outline:0;
}
</style>
祝你好运。