【问题标题】:Vertical scroll table body inside bootstrap modal引导模式内的垂直滚动表体
【发布时间】:2015-09-15 02:00:06
【问题描述】:

我正在使用 bootstrap3 模态并尝试在模态中创建一个表。 我希望 tbody 有垂直滚动。我尝试将 height 和 overflow-y: auto 添加到 tbody,但它不起作用。

我可以让整个模态滚动,但我只希望表格主体可以滚动

谁能帮帮我?

【问题讨论】:

  • 对不起,删除了我的答案...
  • 没关系。我实际上是在尝试修改您的答案。还是没有希望。不过还是谢谢。

标签: twitter-bootstrap-3 scroll html-table


【解决方案1】:

我终于找到了答案。

我从这里改编了代码:http://jsfiddle.net/T9Bhm/7/

CSS 解决方案:

    table {
        width: 100%;
    }

    thead, tbody, tr, td, th { display: block; }

    tr:after {
        content: ' ';
        display: block;
        visibility: hidden;
        clear: both;
    }

    thead th {
        height: 30px;

        /*text-align: left;*/
    }

    tbody {
        height: 120px;
        overflow-y: auto;
    }

    thead {
        /* fallback */
    }


    tbody td, thead th {
        width: 19.2%;
        float: left;
    }

【讨论】:

    猜你喜欢
    • 2019-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-08
    • 1970-01-01
    • 1970-01-01
    • 2013-05-31
    • 1970-01-01
    相关资源
    最近更新 更多