简体   繁体   English

电子邮件中带有TD填充的HTML表

[英]HTML table with TD padding in email

I've got a problem with a table inside an email. 我的电子邮件中的表格有问题。 The table looks good in the browser and in Gmail but not in Outlook 2007/10/13. 该表在浏览器和Gmail中看起来不错,但在Outlook 2007/10/13中却不然。 It goes wrong with the padding in the right table cell I think. 我认为正确的表格单元格中的填充有问题。 Some website say that padding isn't fully supported in email clients. 一些网站说,电子邮件客户端不完全支持填充。

Does anyone have some suggestions for me? 有人对我有什么建议吗?

Here is an image of the browser and Gmail: 这是浏览器和Gmail的图像: 在此处输入图片说明

Here is an image of Outlook: 这是Outlook的图像: 在此处输入图片说明

Here is the full code of the table: 这是表的完整代码:

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

I solved this by adding an extra table inside a . 我通过在中添加一个额外的表来解决此问题。 Then I moved the padding from the to the cellpadding of the table. 然后,将填充从移到表格的cellpadding。 Works great in the most common mailclients. 在最常见的邮件客户端中效果很好。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM