2 回答

TA貢獻1836條經驗 獲得超4個贊
對于Bootstrap 4.0:
在Bootstrap 4.0.0中,您不能col-*可靠地使用這些類(在Firefox中有效,但在Chrome中不可用)。您需要使用OhadR的答案:
<tr>
<th style="width: 16.66%">Col 1</th>
<th style="width: 25%">Col 2</th>
<th style="width: 50%">Col 4</th>
<th style="width: 8.33%">Col 5</th>
</tr>
對于Bootstrap 3.0:
在twitter bootstrap 3中使用:class="col-md-*"其中*是寬度的列數。
<tr class="something">
<td class="col-md-2">A</td>
<td class="col-md-3">B</td>
<td class="col-md-6">C</td>
<td class="col-md-1">D</td>
</tr>
對于Bootstrap 2.0:
在twitter bootstrap 2中使用:class="span*"其中*是寬度的列數。
<tr class="something">
<td class="span2">A</td>
<td class="span3">B</td>
<td class="span6">C</td>
<td class="span1">D</td>
</tr>
**如果您有<th>元素,請在此處而不是在元素上設置寬度<td>。

TA貢獻1821條經驗 獲得超6個贊
我遇到了同樣的問題,我將表固定了,然后指定了td寬度。如果您有,也可以做。
table {
table-layout: fixed;
word-wrap: break-word;
}
模板:
<td style="width:10%">content</td>
請使用CSS構造任何布局。
- 2 回答
- 0 關注
- 1649 瀏覽
相關問題推薦
添加回答
舉報