Outlook 折叠 HTML 电子邮件中的表格单元格
我遇到过这个问题,但尚未找到解决方案。对于 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 中的设置导致单元格宽度折叠。通常,这只发生在我们公司首席执行官的 Outlook 中。我不再以这种方式编写带有副本的单元格,因为我有一种更可靠的工作方式,但有时营销人员认为他们知道自己在做什么,并更改了我的代码,认为它会起作用,而我知道它会起作用不在 CEO 计算机上的 Outlook 中。
有人知道 Outlook 中的什么设置会导致此问题吗?我希望在我的计算机上拥有此设置,这样我就不需要首席执行官来测试它。
I have come across this issue and have yet to be able to find a solution to it. With an html e-mail I have found that in some Outlook programs it will collapse the cell. Both 2007/2010 For instance:
<tr>
<td width="10"><img></td>
<td width="80">Copy</td>
<td width="10"><img></td>
</tr>
What happens is that Outlook ignores the width of the middle column's cell. It also doesn't matter if I use CSS for the widths.
<tr>
<td style="width:10px;"><img></td>
<td style="width:80px;">Copy</td>
<td style="width:10px;"><img></td>
</tr>
This has the same results.
The thing I haven't been able to figure out, is the setting in Outlook that causes this collapsing of the cell's width. And typically, it only happens in Outlook for the CEO of our company. I no longer code a cell with copy in it this way anymore as I have a more rock solid way that works, but sometimes marketing thinks they know what they are doing and changes the code on me thinking it will work, when I know it will not on the CEO's computer in Outlook.
Does anybody know what setting in Outlook causes this? I'd love to have this setting on my computer so I don't need to but the CEO to test it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您能否提供一个更广泛的代码示例,包含整个表而不仅仅是一行?将有助于提供线索为什么会发生这种情况。
无论如何,在 Outlook 中对我有用的方法是在表格中添加顶行,强制列宽达到精确的高度。 1x1 透明 GIF,除了表格单元格宽度之外还设置了宽度,似乎是一种甚至 Outlook 都会监听的“强力”方法:
然后其下方的行与顶行的列宽一致。
Can you provide a more extensive code example w/ a whole table and not just one row? Would help give a clue why this is happening.
Anyway, something that works for me in Outlook is to add a top row in the table that forces the column widths to exact heights. A 1x1 transparent GIF, with widths set in addition to table cell widths, seems to work as a 'brute force' method that even Outlook listens to:
and then rows beneath that conform to the column widths of that top row.
我在 Outlook 2013 for Windows 中遇到了这个问题。它在 Outlook for Mac(以及 Gmail,以及几乎所有其他现代电子邮件客户端)中运行良好,但在 Outlook 2013 for Windows 中,它会完全崩溃一切。
解决方案很简单:如果您声明像素宽度(内联样式除外),则不要输入 px。你必须是真正的老派。这是我的最终(工作)代码:
I was running into this issue in Outlook 2013 for Windows. It worked fine in Outlook for Mac (and Gmail, and pretty much every other modern email client) but in Outlook 2013 for Windows, it would completely collapse everything.
The solution was simple: do NOT put in px if you are declaring a pixel width (with the exception of inline styles). You have to be really old school. Here was my final (working) code: