Outlook 电子邮件模板 - 填充/距离有哪些技巧?

发布于 2024-10-11 14:49:12 字数 3083 浏览 2 评论 0原文

我讨厌写电子邮件模板。

话虽如此,我已经创建了一个相当不错的表格模板,但 Outlook 2007 和 Outlook 2010 在 TR 之间创建的间距比我在其他电子邮件客户端中注意到的要大。

OL 2007 (http://screencast.com/t/YJ5LdTkiGR) OL 2010 (http://screencast.com/t/Ob1ii370C)

代码如下。如果您能帮助我在 Outlook 中正常工作,我将不胜感激,这样我就可以学习,下次就不必打扰您了:)

<html>
<body>

<style>
tr {border:none;}
</style>

<table id="container" border="0"  background-color="#D3E2E9" width="620px" cellpadding="0" cellspacing="0" style="background:#D3E2E9;">
 <tr><td>


<table id="container_border"  cellpadding="0" cellspacing="0" style="border:1px solid #85898B; width:570px; margin-left:20px; margin-top:20px; margin-bottom:20px;">
 <tr><td>
<!-- content -->
<table id="content"  cellpadding="0" cellspacing="0" style="margin-left:15px; margin-top:20px; margin-bottom:20px;padding:10px; width:517px; background:white;">
 <tr><td>

 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/7.jpg"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">Announcing, da, da, da, DAAAAAAAAAAA, the brand new awesomely helpful, 
wildly interesting Back Bay Shutter Company website. Full of juicy information 
on all of our products, from shutters, shades and blinds to Shoji panels, this 
site will help make the job of choosing just the right window treatment a snap.</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/8.jpg"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">We even have product videos, so you can actually see how a product looks and 
works in people's homes (and who doesn't like a peak at someone else's home?). 
We also have a blog, brimming with design news and views. 
</td>
 </tr>
<tr>
<td>&nbsp;</td>
</tr>
 <tr>

<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:90px; padding:0 22px; font-weight:bold;">
<table>
<tr>
<td>
<a href="" title="Join Our Facebook Page"><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/6.jpg" border="0"></a>
</td>
<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; font-weight:bold;">
So become a Facebook fan and stay updated on what we're doing. And stop by often. We can't wait to show you around.
</td>
</tr>
</table>

</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/3.jpg"></td>
 </td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>

</body>
</html>

i hate writing email templates.

with that said, i have a pretty good table'd template created yet Outlook 2007 and Outlook 2010 is creating a lot of spacing between the TR than I notice in other email clients.

OL 2007 (http://screencast.com/t/YJ5LdTkiGR)
OL 2010 (http://screencast.com/t/Ob1ii370C)

The code is found below. Any help in getting things to work in Outlook would be greatly appreciated so I can learn and next time not have to bug you :)

<html>
<body>

<style>
tr {border:none;}
</style>

<table id="container" border="0"  background-color="#D3E2E9" width="620px" cellpadding="0" cellspacing="0" style="background:#D3E2E9;">
 <tr><td>


<table id="container_border"  cellpadding="0" cellspacing="0" style="border:1px solid #85898B; width:570px; margin-left:20px; margin-top:20px; margin-bottom:20px;">
 <tr><td>
<!-- content -->
<table id="content"  cellpadding="0" cellspacing="0" style="margin-left:15px; margin-top:20px; margin-bottom:20px;padding:10px; width:517px; background:white;">
 <tr><td>

 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/7.jpg"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">Announcing, da, da, da, DAAAAAAAAAAA, the brand new awesomely helpful, 
wildly interesting Back Bay Shutter Company website. Full of juicy information 
on all of our products, from shutters, shades and blinds to Shoji panels, this 
site will help make the job of choosing just the right window treatment a snap.</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/8.jpg"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">We even have product videos, so you can actually see how a product looks and 
works in people's homes (and who doesn't like a peak at someone else's home?). 
We also have a blog, brimming with design news and views. 
</td>
 </tr>
<tr>
<td> </td>
</tr>
 <tr>

<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:90px; padding:0 22px; font-weight:bold;">
<table>
<tr>
<td>
<a href="" title="Join Our Facebook Page"><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/6.jpg" border="0"></a>
</td>
<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; font-weight:bold;">
So become a Facebook fan and stay updated on what we're doing. And stop by often. We can't wait to show you around.
</td>
</tr>
</table>

</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/3.jpg"></td>
 </td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>

</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谷夏 2024-10-18 14:49:12

请尝试使用下面的内联样式来清空 tds,以避免更多间距,因为空 tds

style="font-size:0%; line-height:1px; mso-line-height-rule:exactly;"

简单而快乐的编码

Please try to use below inline style to empty tds avoid more spacing of because empty tds

style="font-size:0%; line-height:1px; mso-line-height-rule:exactly;"

simple and happy coding

初见 2024-10-18 14:49:12

额外的空间是由该空行引起的:

<tr>
<td> </td>
</tr>

尝试将该行替换为:

<tr>
<td height="0" style="padding: 0; margin: 0; height: 0;"></td>
</tr>

另外,有时在处理 Outlook 时,最简单的方法是使用
来设置间距。

这是完整的 HTML,在最后一段末尾添加了 2 个

<html>
<body>

<style>
tr {border:none;}
</style>

<table id="container" border="0"  background-color="#D3E2E9" width="620px" cellpadding="0" cellspacing="0" style="background:#D3E2E9;">
 <tr><td>


<table id="container_border"  cellpadding="0" cellspacing="0" style="border:1px solid #85898B; width:570px; margin-left:20px; margin-top:20px; margin-bottom:20px;">
 <tr><td>
<!-- content -->
<table id="content"  cellpadding="0" cellspacing="0" style="margin-left:15px; margin-top:20px; margin-bottom:20px;padding:10px; width:517px; background:white;">
 <tr><td>

 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/7.jpg"  style="display:block"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">Announcing, da, da, da, DAAAAAAAAAAA, the brand new awesomely helpful, 
wildly interesting Back Bay Shutter Company website. Full of juicy information 
on all of our products, from shutters, shades and blinds to Shoji panels, this 
site will help make the job of choosing just the right window treatment a snap.</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/8.jpg"  style="display:block"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">We even have product videos, so you can actually see how a product looks and 
works in people's homes (and who doesn't like a peak at someone else's home?). 
We also have a blog, brimming with design news and views.<br><br>
</td>
 <tr>

<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:90px; padding:0 22px; font-weight:bold;">
<table>
<tr>
<td>
<a href="" title="Join Our Facebook Page"><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/6.jpg" border="0" style="display:block"></a>
</td>
<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; font-weight:bold;">
So become a Facebook fan and stay updated on what we're doing. And stop by often. We can't wait to show you around.
</td>
</tr>
</table>

</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/3.jpg"></td>
 </td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>

</body>
</html>

The extra space is caused by this empty row:

<tr>
<td> </td>
</tr>

Try replacing that row with:

<tr>
<td height="0" style="padding: 0; margin: 0; height: 0;"></td>
</tr>

Alternatively, sometimes when dealing with Outlook it's easiest to use <br> for spacing.

Here's your full HTML with 2 <br> added at the end of the last paragraph:

<html>
<body>

<style>
tr {border:none;}
</style>

<table id="container" border="0"  background-color="#D3E2E9" width="620px" cellpadding="0" cellspacing="0" style="background:#D3E2E9;">
 <tr><td>


<table id="container_border"  cellpadding="0" cellspacing="0" style="border:1px solid #85898B; width:570px; margin-left:20px; margin-top:20px; margin-bottom:20px;">
 <tr><td>
<!-- content -->
<table id="content"  cellpadding="0" cellspacing="0" style="margin-left:15px; margin-top:20px; margin-bottom:20px;padding:10px; width:517px; background:white;">
 <tr><td>

 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/7.jpg"  style="display:block"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">Announcing, da, da, da, DAAAAAAAAAAA, the brand new awesomely helpful, 
wildly interesting Back Bay Shutter Company website. Full of juicy information 
on all of our products, from shutters, shades and blinds to Shoji panels, this 
site will help make the job of choosing just the right window treatment a snap.</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/8.jpg"  style="display:block"></td>
 </tr>
 <tr>
  <td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:20px; padding:0 52px; font-weight:bold;">We even have product videos, so you can actually see how a product looks and 
works in people's homes (and who doesn't like a peak at someone else's home?). 
We also have a blog, brimming with design news and views.<br><br>
</td>
 <tr>

<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; margin-top:90px; padding:0 22px; font-weight:bold;">
<table>
<tr>
<td>
<a href="" title="Join Our Facebook Page"><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/6.jpg" border="0" style="display:block"></a>
</td>
<td style="font-family:arial,sans-serif;font-size:11px; line-height:150%; color:#000; font-weight:bold;">
So become a Facebook fan and stay updated on what we're doing. And stop by often. We can't wait to show you around.
</td>
</tr>
</table>

</td>
 </tr>
 <tr>
  <td><img src="https://origin.ih.constantcontact.com/fs089/1103957675139/img/3.jpg"></td>
 </td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>

</body>
</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文