html - 在 Outlook 中查看时,表格的右边框未显示在电子邮件模板中

标签 html css email outlook html-email

我浏览了很多线程,但找不到有用的东西。如果这是重复的,请将我指向相关线程。

我们为我们的网站之一创建了自定义 RSS 提要,以实现我们想要的模板设计。除了 Outlook,我已经设法让它在几乎所有地方看起来都很好,这很痛苦!

我面临的主要问题是我无法在其中一个框中显示正确的边框。 请参阅随附的屏幕截图。 enter image description here

这是我的 HTML。我也尝试过使用百分比作为宽度,但也没有用。

<table width="525" height="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#fafafa" class="main-content"  style="border:1px solid #ccc;">
    <tr>
        <td width="50"><!-- --></td>
        <td width="284" align="left" valign="middle"><img src="'.site_url().'/wp-content/uploads/'.$image.'" width="274" height="196" mc:edit="Box_image_2" mc:allowdesigner alt=""  /></td>
        <td width="20"><!-- --></td>
        <td width="280" valign="top" >
            <table width="220" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td  height="15"><!-- --></td>
                </tr>
                <tr>
                    <td align="left" class="body-text-bold" style="font-size:16px;font-weight:bold;" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><strong>'.$deal['post_title'].'</strong></td>
                </tr>
                <tr>
                    <td  height="16"><!-- --></td>
                </tr>
                <tr>
                    <td><!-- Red Box Start -->
                        <div class="red-box" style="background:#e9e9e9;border:1px solid #ccc;">
                            <table border="0" align="center"  cellpadding="0" cellspacing="0">
                                <tr>
                                    <td height="5"><!-- --></td>
                                </tr>
                                <tr>
                                    <td width="7"><!-- --></td>
                                    <td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td  height="5"><!-- --></td>
                                            </tr>
                                            <tr>
                                                <td width="30"></td>
                                                <td align="left" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_1" mc:allowdesigner="mc:allowdesigner">Τιμή</td>
                                                <td width="30"></td>
                                            </tr>
                                            <tr>
                                                <td height="5"><!-- --></td>
                                            </tr>
                                            <tr>
                                                <td width="25"></td>
                                                <td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_2" mc:allowdesigner="mc:allowdesigner">'.$price.'&#8364;</td>
                                                <td width="20"></td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="5"><!-- --></td>
                                    <td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
                                        <table  cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td  height="10"><!-- --></td>
                                            </tr>
                                            <tr>
                                                <td width="25"></td>
                                                <td align="left"  class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;"  mc:edit="top_box_discount_1" mc:allowdesigner="mc:allowdesigner">Έκπτωση</td>
                                                <td width="30"></td>
                                            </tr>
                                            <tr>
                                                <td height="5"><!-- --></td>
                                            </tr>
                                            <tr>
                                                <td width="35"></td>
                                                <td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_discount_2" mc:allowdesigner="mc:allowdesigner">'.$discount.'</td>
                                                <td width="5"></td>
                                            </tr>
                                            <tr>
                                                <td height="15"></td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td width="5"><!-- --></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td height="5"><!-- --></td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="12"><!-- --></td>
                </tr>
                <tr>
                    <td align="left" class="body-text-bold" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><!--REMOVED BY DUSTIN '.$deal['post_content'].'--></td>
                </tr>
                <tr>
                    <td  height="0"><!-- --></td>
                </tr>
                <tr>
                    <td align="center" mc:edit="top_box_image" mc:allowdesigner="mc:allowdesigner" width="120px" style="background-color:#ac0003; color:#ffffff; border:1px solid #660b0e;cursor: pointer; display: block; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-top:5px; padding-bottom:5px; text-decoration:none; "><a style="color:#ffffff; text-decoration:none;" href="'.$deal['guid'].'" class="">Δες το Deal</a> </td>
                </tr>
            </table>
        </td>
        <td width="0"><!-- --></td>
    </tr>
</table>

如果这有帮助:我使用 FEED 标签通过 MailChimp 发送电子邮件。

在此先感谢您的帮助!

最佳答案

我认为这个问题是由表格单元格的宽度引起的。尝试像这样为每个表格单元格设置两次宽度:

<td width="10" style="width:10px;">

同时添加以下嵌入样式:

table td {border-collapse: collapse;}
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }

提示: 您可能想要指定导致问题的 Outlook 版本。例如,Outlook 2007/2010/2013 对相同样式的 react 与 Outlook 2003/2011 完全不同。

关于html - 在 Outlook 中查看时,表格的右边框未显示在电子邮件模板中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16406439/

相关文章:

javascript - 在 MVC razor 中使用 jQuery UI Datepicker 出现错误

html - 确保相对定位的元素留在顶部容器内

javascript - Google 协作平台 HTML 框无法识别 CSS 或 Javascript

javascript - Webpack 正在破坏我的 .scss 样式表类

css - 手机版没有出现在iphone上

css - 在 n 个数字字符或像素后使用 CSS 包装一个单词

javascript - 现代浏览器是否像图像一样支持 HTML 中的 base64 编码的 JS 或 CSS block ?

Android:可以在不写入 SD 的情况下将文件附加到电子邮件吗?

email - Liferay 6.1.20EE如何通过MailServiceUtil检查E-Mail是否成功发送

html - Android:如何在 ListView 中添加 HTML 链接?