td中嵌套table后td中的colspan属性失效

xiaoxiao2021-02-28  50

<table width="600px" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" style="border-collapse: collapse;" align="center">   <tr style="height: 30px;">    <td width="100" style="text-align: center;font-weight: bold;">产品/项目名称</td>    <td colspan="3">${model.name }</td>

  </tr>

<tr style="display: block;">   <td colspan="4" style="padding: 0;margin: 0;">   <table width="600px" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;" align="center"> <tr style="text-align: center;height: 30px;"> <td colspan="6" style="font-weight: bold;">明细</td> </tr> <tr style="text-align: center;height: 30px;"> <td style="border-top: 1px solid #000;border-right: 1px solid #000;width: 120px;">名称</td> <td style="border-top: 1px solid #000;border-right: 1px solid #000;width: 107px;">数量</td> <td style="border-top: 1px solid #000;border-right: 1px solid #000;width: 100px;">型号</td> <td style="border-top: 1px solid #000;border-right: 1px solid #000;width: 90px;"> 单价(元)</td> <td style="border-top: 1px solid #000;border-right: 1px solid #000;width: 90px;">金额(元)</td> <td style="border-top: 1px solid #000;width: 50px;">事由</td> </tr>

</table>

</td>

</tr>

</table>

td中嵌套table样式出现问题,因为colspan="4"没有起到作用,原因是tr中的style="display: block;"的影响,改为style="display: table-row;"后问题消失

转载请注明原文地址: https://www.6miu.com/read-1600339.html

最新回复(0)