
<style type="text/css">
table{ width:500pxheight:300px}
td{ border:solid 2px red}
</style>
<table>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
这样试一下是可以设置上宽度和高度的。
当 table 加上 table-layout: fixed 时,或者 表格开头第一行存在合并行 colspan表格宽度会存在失效,或者溢出当前 div
tips:col 宽度设置为 % ,table 也需要设置为 width:100%
单独给 td 设置 text-overflow: ellipsis存在溢出当前盒子;或者失效;或者宽度异常等情况
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)