在电子邮件中使用TD填充的HTML表格

问题描述:

我在电子邮件中的表格中遇到问题。 表格在浏览器和Gmail中看起来不错,但在Outlook 2007/10/13中看起来不错。它在我认为正确的表格单元格中出现填充错误。 有些网站说,电子邮件客户端并不完全支持填充。在电子邮件中使用TD填充的HTML表格

有没有人对我有一些建议?

这里是浏览器和Gmail的图像: enter image description here

下面是Outlook的图像: enter image description here

下面是表的全码:

<table border="0" cellspacing="10" cellpadding="0" style="width: 600px; white-space: normal;"> 
 
    <tr> 
 
    <td style="width: 100px; vertical-align: top; background-color: #fff; border: 1px solid #000000;"> 
 
     <p>a</p> 
 
    </td> 
 
    <td style="padding: 25px; width: 416px; vertical-align: top; background-color: #fff; border: 1px solid #000000;"> 
 
     <p>b</p> 
 
    </td> 
 
    </tr> 
 
</table>

+0

有任何CSS? – floor 2015-03-13 15:34:16

+0

尝试添加* {padding:0;余量:0; }到你的CSS文件的顶部 – floor 2015-03-13 15:34:56

我解决了这个问题b你在一个表里添加一个额外的表格。 然后我将填充从表格的cellpadding移动。 适用于最常见的邮件客户端。

<table border="0" cellspacing="10" cellpadding="0" style="width: 600px; white-space: normal;"> 
 
    <tr> 
 
    <td style="width: 100px; vertical-align: top; background-color: #fff; border: 1px solid #000000;"> 
 
     <table> 
 
     <tr> 
 
      <td> 
 
      <p>a</p> 
 
      </td> 
 
     </tr> 
 
     </table> 
 
    </td> 
 
    <td style="width: 416px; vertical-align: top; background-color: #fff; border: 1px solid #000000;"> 
 
     <table cellpadding="25"> 
 
     <tr> 
 
      <td> 
 
      <p>b</p> 
 
      </td> 
 
     </tr> 
 
     </table> 
 
    </td> 
 
    </tr> 
 
</table>