微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 内置响应表的Bootstrap面板

这是一个JS Bin链接http://jsbin.com/qiziyupo/4/edit?output

响应表不会收缩以适合面板.我怎样才能解决这个问题?

编辑:我正在寻找一个解决方案,响应表将调整大小以适应面板内部,而不必使面板更大.

解决方法

.table-responsive类只是为了对移动设备做出响应……

从Bootstrap 3.1.1文档……

Create responsive tables by wrapping any .table in .table-responsive to make them scroll horizontally up to small devices (under 768px). When viewing on anything larger than 768px wide,you will not see any difference in these tables

但是您可以在没有媒体查询的情况下将类添加到css中,并在任何视口中获取功能.

但请注意,这不会缩小表格,它只给出一个水平滚动条…

下面是来自Bootstrap的.table响应类,没有媒体查询将其限制为768px及以下.

.table-responsive {
    width: 100%;
    margin-bottom: 15px;
    overflow-y: hidden;
    overflow-x: scroll;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    border: 1px solid #ddd;
    -webkit-overflow-scrolling: touch;
}

.table-responsive>.table { 
    margin-bottom: 0;
}

.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td {
    white-space: Nowrap;
}

还有一些针对.table-bordered的CSS规则,我没有包括……

原文地址:https://www.jb51.cc/css/215467.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。