【问题标题】:How to make a table horizontally scrollable and the tbody vertically scrollable如何使表格水平滚动和tbody垂直滚动
【发布时间】:2021-05-21 03:47:32
【问题描述】:

我有一个带有引导类表响应的 html 表。在水平滚动时,我希望整个表格滚动,但在垂直滚动时,我只希望 tbody 滚动。有什么想法吗??

【问题讨论】:

    标签: html css bootstrap-4


    【解决方案1】:

    也许你可以试试这个。

    表格的 HTML 代码:

    <div class="table-container">
      //table goes in here
    </div>
    

    CSS 代码:

    .table-container {
      width: //your choice;
      height: //your choice;
      overflow-y: scroll;
    }
    

    tbody 的 CSS:

    tbody {
      overflow-x: scroll;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-09
      • 2011-01-12
      • 2022-06-21
      • 2019-04-13
      • 1970-01-01
      • 2019-07-27
      • 2021-11-13
      • 1970-01-01
      相关资源
      最近更新 更多