【问题标题】:Outlook 2010 spacing issue between tables rowsOutlook 2010 表格行之间的间距问题
【发布时间】:2012-07-25 08:19:48
【问题描述】:

我有一个包含 3 列 (25px : 580px : 25px) 的单表 HTML,整个表、trs 和 tds 都是白色背景。除 Outlook 2010 外,所有浏览器均可使用。

在 Outlook 2010 中,我在表格行之间的两个外部列中收到垂直间隙 - 大约 3 像素的间隙。似乎背景白色没有显示在整个单元格中,或者 Outlook 正在添加换行符或类似内容。

此处截图:

受影响行的结构如下:

<tr><td height="20" width="25" align="left" valign="top" bgcolor="#ffffff"></td>
<td height="20" width="580" align="left" valign="top" bgcolor="#ffffff"></td>
<td height="20" width="25" align="left" valign="top" bgcolor="#ffffff"></td>
</tr>

有谁知道是什么原因造成的以及如何解决?

【问题讨论】:

  • 试试border-collapse: collapse;

标签: html html-table html-email outlook-2010


【解决方案1】:

可能的解决方案:

  1. 使用 CSS 设置 background-color: #ffffff
  2. 在受影响的tds中添加&amp;nbsp;,并使用CSS设置font-size: 0pxline-height: 0px
  3. 同时尝试以上两种方法 :)

【讨论】:

    【解决方案2】:

    图像应设置为内联显示:块

    添加到您的嵌入式 CSS:

    table, table td { border:0; border-collapse:collapse; mso-table-lspace:0; mso-table-rspace:0; margin:0; padding:0; }`
    

    你应该把你的 bgcolors 放在标签而不是表格单元格中:

    <table bgcolor="#ededed" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td>
        <table bgcolor="#ffffff"cellpadding="0" cellspacing="0" border="0">
        <tr>
           <td height="20" width="25" align="left" valign="top"></td>
          <td height="20" width="580" align="left" valign="top"></td>
          <td height="20" width="25" align="left" valign="top" ></td>
        </tr>
        </table>
      </td>
    </tr>
    </table>
    

    【讨论】: