【问题标题】:Scrollable table vertical only仅垂直可滚动表格
【发布时间】:2018-07-27 03:51:12
【问题描述】:

我将我的表格包含在一个 div 中以拥有overflow: scroll。但是,它也在水平方向插入滚动。我只想要垂直的滚动条。

<div style="height: 700px !important; width: 100%; overflow: scroll;">
    <table class="table table-bordered">
        <!-- Content Here -->
    </table>
</div>

【问题讨论】:

标签: html css twitter-bootstrap


【解决方案1】:

overflow-y 属性指定当块级元素在顶部和底部边缘溢出时,是否剪切内容、添加滚动条或显示溢出内容。

<div style="height: 700px !important; width: 100%; overflow-y: scroll;">
    <table class="table table-bordered">
        <!-- Content Here -->
    </table>
</div>

【讨论】:

    【解决方案2】:

    你可以使用overflow-y: scroll;或溢出-y:自动;属性

    overflow-y 属性指定当块级元素在顶部和底部边缘溢出时,是否剪切内容、添加滚动条或显示溢出内容。

    https://www.w3schools.com/CSSref/css3_pr_overflow-y.asp

    【讨论】:

      猜你喜欢
      • 2012-02-28
      • 2011-07-31
      • 2018-03-03
      • 2020-02-07
      • 1970-01-01
      • 2019-11-08
      • 2017-08-01
      • 2012-07-04
      • 2017-12-07
      相关资源
      最近更新 更多