更改表宽度
问题描述:
我有表,有15列,以表看不整洁和列值了超过1线在盒子更改表宽度
如何延长表格的宽度或使表别的东西所以价值在桌子上看起来更整齐,只用1行的方块?
查看:
<table class="table">
<tr>
<th> a </th>
<th> b </th>
<th> c </th>
<th> d </th>
<th> e </th>
<th> f </th>
<th> g </th>
<th> h </th>
<th> i </th>
<th> j </th>
<th> k </th>
<th> l </th>
<th> m </th>
<th> n </th>
<th> o </th>
<th>Actions</th>
</tr> @foreach (var item in group) {
<tr>
<td> aa </td>
<td> bb </td>
<td> cc </td>
<td> dd </td>
<td> ee </td>
<td> ff </td>
<td> gg </td>
<td> hh </td>
<td> ii </td>
<td> jj </td>
<td> kk </td>
<td> ll </td>
<td> mm </td>
<td> nn </td>
<td> oo </td>
<td> actions </td>
</tr>
</table>
答
只需使用下面的CSS此
.table th, .table td {
white-space: nowrap;
}
答
添加th
和td
white-space:nowrap
财产。