jquery - Bootstrap 表溢出

标签 jquery html css twitter-bootstrap

我想溢出我的 table 。

-----------------------
|  name  |  height  |
-----------------------
| john   |  5,8     ^
| josh   |  6,4     |
| joshua |  5,4     |
| jon    |  5,5     V
-----------------------

我使用了 overflow-y:scroll; 但我想要的是,只有表体在滚动。我想要的就像我上面的例子。

<table class="table table-hover table-responsive">
<thead>
  <tr>
    ...
  </tr>
</thead>
<tbody>
  <tr>
   ...
  </tr>
  <tr>
   ...
  </tr>
</tbody>

是否可以只溢出表体部分?我正在使用 Bootstrap 。

最佳答案

最简单的方法:

在一个表中添加两个表,比如 tabel1 和 table2。 现在在 table1 中包含表头,在 table2 中包含表体。 对表 2 使用 style="overflow:auto;"style="overflow:scroll;"

关于jquery - Bootstrap 表溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35548970/

相关文章:

javascript - JQuery - 允许选择特定的 2 个复选框

javascript - 检查 <div> 是否已与 data-url 异步加载

javascript - 使用jquery在点击时显示dd

javascript - 我的 reveal on hover 功能不起作用,为什么?

html - 只有 html 和 css 的进度条

jQuery 无缝轮播

javascript - 每行的子列相等

javascript - 如何在我的注册表单中使用 jquery 验证

javascript - 无法禁用/覆盖上下文菜单 Safari 全屏模式

html - 是否可以制作以 SVG 线开头的完美圆的动画