【发布时间】:2017-02-02 23:56:25
【问题描述】:
几个小时前,我从 Bootstrap 3.0.3 升级到 3.1.1,我的所有表格突然水平折叠到最小宽度。今天早些时候,这个表格显示得很好,占据了 .container 对象的整个宽度
<div class="table-responsive">
<table class="table table-striped table-condensed" id="intakes_header">
<caption class="h2">Annual Intakes [1]</caption>
<thead style="height: auto;" id="intakes_head" class="intakes_targets in">
<tr>
<th>School Year</th>
<th>Referred By</th>
<th>Exit Date</th>
<th> </th>
</tr>
</thead>
<tbody style="height: auto;" id="intakes_body" class="intakes_targets col-sm-12 in">
<tr>
<td>2013-14</td>
<td>SAFE House</td>
<td>-</td>
<td><a href="https://localhost/EPHY/index.php/familyschoolyear/3827/edit" class="btn btn-default btn-sm" \=""><span class="glyphicon glyphicon-pencil"></span></a></td>
</tr>
</tbody>
</table>
</div>
现在<caption> 运行全宽,但列是显示内容所需的最小大小,并且标题甚至不与它们下方的列内容对齐。真正奇怪的部分是我一直在尝试添加 col-md-X 类,如果我添加一个加起来为 12 的集合,则列正常显示,否则它们仍然被压扁,即
<tr>
<th class='col-sm-3'>School Year</th>
<th class='col-sm-3'>Referred By</th>
<th class='col-sm-3'>Exit Date</th>
<th class='col-sm-2'> </th>
</tr>
在没有类的情况下显示为挤压在一起,但是
<tr>
<th class='col-sm-3'>School Year</th>
<th class='col-sm-3'>Referred By</th>
<th class='col-sm-3'>Exit Date</th>
<th class='col-sm-3'> </th>
</tr>
将它们顺利展开。自升级以来,这影响了我在应用程序中查看的每个表。
显然,我应该能够通过手动添加列类来分散表格,但这也将我锁定在固定的宽度比例中,这并不总是合适的,具体取决于返回哪些记录来填充表格。我只是想弄清楚这里发生了什么(显然)打破了桌子。关于检查什么有什么建议吗?
【问题讨论】:
-
您介意将您的问题放入 jsfiddle 或 jsbin 中吗?
-
我不知道怎么做。关于寻找说明的最佳位置有什么建议吗?
标签: twitter-bootstrap html-table