Bootstrap水平滚动表 [英] Bootstrap Horizontal Scrollable Table

查看:73
本文介绍了Bootstrap水平滚动表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为此苦了一段时间了。我在引导程序中有一个表格,如果表格过宽,我想使其滚动,以便他们至少可以滚动以查看信息。

I have been struggling with this for a while now. I have a table in bootstrap that if it gets to wide I would like to make it scrollable so they can at least scroll to see the information.

我的html很简单,只是一个盒子里的桌子

My html is pretty simple just a table within a box

<div class='box'>
  <div class='box-header'>
    <h4>Title</h4>
  </div>
  <div class='box-content'>
    <table>
    <!--Table Stuff-->
    </table>
  </div>
</div>

,我尝试设置宽度然后是 overflow-x:scroll; 像这样

and I have tries the usual of setting a width and then an overflow-x:scroll; like so

table{
 width:100px;
 max-width:100px;
 overflow-x:scroll;
}

但似乎没有任何作用。

我在这里设置了jsFiddle。 http://jsfiddle.net/AHyuF/3/

I have a jsFiddle set up here. http://jsfiddle.net/AHyuF/3/

任何帮助将不胜感激!

推荐答案

否则,您只需要添加类 table-sensitive 到表 div

or else you just have to add class "table-responsive" to table div

 <div class = "table-responsive">
 </div>

它将使表格可滚动。

这篇关于Bootstrap水平滚动表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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