通常 <table> 最大的长度默认是 100%,当包裹 <table> 的容器宽度很小的时候,会把表格挤的“惨不忍睹”。
<table>
100%
碰到这种情况,如果你想最大程度的撑开表格,可以给 <th>、<td> 设置 white-space: nowrap; 这个 CSS 样式,然后再给容器设置一个 scroll-x: auto 的样式。
<th>
<td>
white-space: nowrap;
scroll-x: auto