当设置为 width="100%" 时,Gmail 应用程序不会扩展 table 超过其内容的宽度

Gmail App does not extend table past the width of it's contents when set to width="100%"

正如标题所暗示的那样,我遇到了一个问题,即 table 的单元格折叠到其中内容的宽度,即使 table 的宽度设置为 100 %.

示例table:

<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>

table 中的某些字段是可选的,因此始终为空。

任何帮助将不胜感激!

好吧,您正在定义和固定 <th style> 标签中已有的宽度。我会给它一个百分比,以便它在 table

中均匀分布
...align="left" width="50%">Vendor</th>

已将 !important 添加到 table html 中的 style="width: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% !important; font-size: 12px; margin: 0;">