首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在html表格上显示滚动条

如何在html表格上显示滚动条
EN

Stack Overflow用户
提问于 2011-11-23 03:38:45
回答 7查看 464K关注 0票数 103

我正在写一个页面,我需要一个html表来维护设置的大小。我需要表格顶部的标题一直留在那里,但我还需要表格的主体滚动,无论向表格中添加了多少行。

我希望它看起来像这个url中的方法2:http://www.cssplay.co.uk/menu/tablescroll.html

我尝试过这样做,但没有出现滚动条:

tbody {
  height: 80em;
  overflow: scroll;
}
<table border=1 id="qandatbl" align="center">
  <tr>
    <th class="col1">Question No</th>
    <th class="col2">Option Type</th>
    <th class="col1">Duration</th>
  </tr>

  <tbody>
    <tr>
      <td class='qid'></td>
      <td class="options"></td>
      <td class="duration"></td>
    </tr>
  </tbody>
</table>

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8232713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档