<table style="width:600px; height:200px;">
<tr>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
</tr>
</table>
table的实际宽度=600px,因为table定义了width;每个td的宽度是(600px-20px*6)/3
<table style="width:600px; height:200px;border-collapse:collapse;">
<tr>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
</tr>
</table>
table的实际宽度=600px,因为table定义了width;每个td的宽度是(600px-20px*4)/3 ,因为table样式中有border-collapse:collapse;,会将相邻td的2个border合并成1个
<table style="height:200px;border-collapse:collapse;">
<tr>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
</tr>
</table>
table的实际宽度=200px*3+20px*4,因为table没有定义宽度,所以table宽度按每个td的宽度+border的宽度;每个td的宽度是(600px+20px*4)/3,
<table style="height:200px;">
<tr>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
<td style="width:200px; border:solid 20px #000;"></td>
</tr>
</table>