我想在row
中每table
只有4列,如何使用css
在表格中强制换行?
请检查我在下面的链接中尝试了什么 -
<table style="table-layout: fixed; width: 100%;">
<tbody>
<tr>
<td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
<td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
<td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
<td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
<td style="word-wrap: break-word;overflow-wrap: break-word;width:25%"></td>
<tr>
</tbody>
</table>
LINK - jsfiddle
答案 0 :(得分:0)
我找到了一种使用Bootstrap的简单方法:
<div class="row">
<div class="col-sm-3" style="background-color:lavender;"><table>...</table></div>
<div class="col-sm-3" style="background-color:lavenderblush;"><table>...</table></div>
<div class="col-sm-3" style="background-color:lavender;"><table>...</table></div>
<div class="col-sm-3" style="background-color:lavenderblush;"><table>...</table></div>
</div>