在bootstrap 3
我可以将col-sm-xx
应用于thead
中的th
标记并随意调整表列的大小。然而,这在bootstrap中不起作用。4.我如何在bootstrap 4中实现这样的功能?bootstrap 4表列大小
<thead>
<th class="col-sm-3">3 columns wide</th>
<th class="col-sm-5">5 columns wide</th>
<th class="col-sm-4">4 columns wide</th>
</thead>
望着codeply只要正确不小,特别是如果你添加一些数据表。看到这是如何运行的:
<div class="container" style="border: 1px solid black;">
<table class="table table-bordered">
<thead>
<tr class="row">
<th class="col-sm-3">3 columns wide</th>
<th class="col-sm-5">5 columns wide</th>
<th class="col-sm-4">4 columns wide</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>456</td>
<td>789</td>
</tr>
</tbody>
</table>
</div>
作为附录这样的问题:如果有长的内容(如非常长的URL)来显示自举4表即使在下面的尺寸回答中也不是一个好的解决方案。无论是使用flex-row还是row/col解决方案,溢出和文本包装都会更好地工作 – Killerpixler