引导程序模式内的垂直滚动表主体 [英] Vertical scroll table body inside bootstrap modal

查看:49
本文介绍了引导程序模式内的垂直滚动表主体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用bootstrap3模态,并试图在模态内创建表.我要使琴身垂直滚动.我已经尝试过将高度和溢出-y:auto添加到tbody,但这是行不通的.

I'm using bootstrap3 modal and trying to create a table inside a modal. I want the tbody to have vertical scroll. I've tried adding the height and overflow-y: auto to tbody, but it won't work.

我能够使整个模式滚动,但是我只希望表格主体可以滚动

I was able to have the entire modal scrollable, but I just want only the table body to be scrollable

有人可以帮助我吗?

推荐答案

我终于找到了答案.

我从此处修改了代码: 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;
    }

这篇关于引导程序模式内的垂直滚动表主体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆