最佳答案
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<p>Css</p>
<style>
table {
border-collapse:collapse; }
.long {
background:yellow; letter-spacing:1em; }
div.first1 {
width: auto;
height: 150px;
padding-bottom: 1px;
position: absolute;
left:0;
top:auto;
}
div.second1 {
width: 600px;
overflow-x:scroll;
overflow-y:visible;
margin-left:5em;
padding-bottom:1px;
height:auto;
}
.headcol {
position: absolute;
width: 5em;
left: 0;
top: auto;
border-right: 0px none black;
border-top-width: 3px;
margin-top: -3px;
}
</style>
</head>
<body>
<p>Html</p>
<div class="first1">
<div class="second1">
<table style="border:1px solid black;" border="1">
<tr>
<td class="headcol">11111111111</td>
<td class="long">22222222222222222222222222222222222222222222</td>
</tr>
<tr>
<td class="headcol">1</td>
<td class="long">22222222222222222222222222222222222222222222</td>
</tr>
<tr>
<td class="headcol">1</td>
<td class="long">22222222222222222222222222222222222222222222</td>
</tr>
<tr>
<td class="headcol">1</td>
<td class="long">22222222222222222222222222222222222222222222</td>
</tr>
<tr>
<td class="headcol">1</td>
<td class="long">22222222222222222222222222222222222222222222</td>
</tr>
</table>
</div>
</div>
</body>
</html>
关于javascript - 如何滚动 "tbody"内的特定区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43180297/