因此,正如标题可能暗示的那样,即使表的宽度设置为100%,我的表的单元格也会崩溃到其中内容的宽度。
表格示例:
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="first-payment-details" align="left" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; width: 100%; font-size: 12px; margin: 0;">
<tr>
<th style=" color: #818182; font-weight: 100; text-align: left !important; padding: 7px; border: 1px solid #e2e2e2;" align="left" width="112">Vendor</th>
<td style=" -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; padding: 7px; border: 1px solid #e2e2e2;">Example Vendor Name</td>
</tr>
</table>
表中的某些字段是可选的,因此始终有空字段。
任何帮助将不胜感激!
已添加!important
到style="width:100%"
表格html中的属性中,并且现在所有功能都可以正常工作。
解决方案:
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="first-payment-details" align="left" style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse !important; width: 100% !important; font-size: 12px; margin: 0;">
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句