【问题标题】:Bootstrap matching table width with containerBootstrap 将表格宽度与容器匹配
【发布时间】:2014-03-31 06:49:54
【问题描述】:

如何使我的桌子的宽度与其容器相匹配?如果没有任何 css 更改,我的表就会溢出并且比它的容器宽得多。

JSFiddle 示例:http://jsfiddle.net/Tet8L/

当我将宽度设置为自动时,我得到一个只填充部分容器的表格。

.table {
  width: auto; (or fixed or none)
}

JSFiddle 示例:http://jsfiddle.net/DDnSL/

有没有办法让我的桌子自动填满整个容器?

【问题讨论】:

    标签: javascript jquery html css twitter-bootstrap


    【解决方案1】:

    在你的html中你有

    <div class="starter-template">
         <div class="container">
             ...
         </div>
    </div>
    

    把这个改成

    <div class="starter-template">
         <div class="container-fluid">
             ...
         </div>
    </div>
    

    Working Example

    更新:

    忘记我刚刚写的,把.container div 去掉,因为你的代码中已经有了.container div。我刚看了一下 Bootstrap 文档,他们说,

    默认情况下容器不可嵌套

    Bootstrap Docs (containers)

    <div class="starter-template">
         <div>
             ...
         </div>
    </div>
    

    Updated Example

    【讨论】:

      猜你喜欢
      • 2018-12-18
      • 1970-01-01
      • 2011-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多