2

我遇到了这个问题,但还没有找到解决方案。使用 html 电子邮件,我发现在某些 Outlook 程序中它会折叠单元格。2007/2010 年例如:

<tr>
    <td width="10"><img></td>
    <td width="80">Copy</td>
    <td width="10"><img></td>
</tr>

发生的情况是 Outlook 忽略了中间列单元格的宽度。如果我使用 CSS 作为宽度也没关系。

<tr>
    <td style="width:10px;"><img></td>
    <td style="width:80px;">Copy</td>
    <td style="width:10px;"><img></td>
</tr>

这具有相同的结果。

我无法弄清楚的是 Outlook 中导致单元格宽度折叠的设置。通常,它只发生在我们公司 CEO 的 Outlook 中。我不再以这种方式编写带有副本的单元格,因为我有一种更可靠的工作方式,但有时营销人员认为他们知道他们在做什么,并在我知道它会工作时更改我认为它会工作的代码不在 Outlook 中 CEO 的计算机上。

有人知道 Outlook 中的什么设置会导致这种情况吗?我很想在我的电脑上安装这个设置,所以我不需要 CEO 来测试它。

4

2 回答 2

0

我在 Outlook 2013 for Windows 中遇到了这个问题。它在 Outlook for Mac(和 Gmail,以及几乎所有其他现代电子邮件客户端)中运行良好,但在 Outlook 2013 for Windows 中,它会完全崩溃。

解决方案很简单:如果您声明像素宽度(内联样式除外),请不要输入 px。你必须是真正的老派。这是我的最终(工作)代码:

    <table cellspacing="0" cellpadding="0" border="0">
    <tr>

    <td width="1" align="left" valign="top" bgcolor="#ffffff"><img src="#"></td>
    <td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 1</a></span></td>

    <td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none; text-decoration: none;" href="#">SECTION 2</a></span></td>

    <td width="150" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 3</a></span></td>

    <td width="149" align="center" bgcolor="#ffffff"><span style="font-size: 11px; font-family: Arial, Helvetica, sans-serif; font-weight: lighter;"><a style="color: #5f6062; text-decoration: none;" href="#">SECTION 4</a></span></td>

    </tr>
    </table>
于 2015-03-17T22:31:45.073 回答
0

您能否提供一个更广泛的代码示例,其中包含整个表格而不仅仅是一行?将有助于提供线索为什么会发生这种情况。

无论如何,在 Outlook 中对我有用的东西是在表格中添加一个顶行,强制列宽精确到高度。一个 1x1 透明 GIF,除了表格单元格宽度外还设置了宽度,似乎可以作为一种“蛮力”方法工作,甚至 Outlook 也会听:

<table>
  <tr>
    <td width="10" height="1"><img width="10" height="1" /></td>
    <td width="80" height="1"><img width="80" height="1" /></td>
    <td width="10" height="1"><img width="10" height="1" /></td>
  </tr>

然后其下方的行符合该顶行的列宽。

于 2011-06-17T20:39:21.793 回答