繁体   English   中英

引导程序与容器匹配表宽度

[英]Bootstrap matching table width with container

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

JSFiddle示例: http : //jsfiddle.net/Tet8L/ 表溢出了容器。

当我将宽度设置为auto时,得到的表只填充了部分容器。

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

JSFiddle示例: http : //jsfiddle.net/DDnSL/ 表格宽度太短。

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

在你的HTML中

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

更改为

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

工作实例

更新:

忘了我刚刚写的内容,只是摆脱.container div,因为您的代码中已经有一个.container div。 我只是看了一下Bootstrap文档,他们说,

默认情况下,容器不可嵌套

Bootstrap Docs(容器)

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

更新示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM