2017-03-16 46 views
0

我正在製作一個HTML電子郵件,它可以在不使用媒體查詢的情況下響應。它可以工作,但在我們很多客戶使用的Microsoft Outlook 2010中,它顯示了兩個表之間的差距。在其他任何設備上,它都不顯示間隙。我如何消除Outlook中的差距?用於Outlook的HTML電子郵件中的不需要的間隙

enter image description here

注:我需要使用多個表,以便將電子郵件響應。如果我使用另一個td,它將不會響應。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
     <title></title> 
     <style type="text/css"> 
     table td { 
      border-collapse: collapse; 
     } 
     .msoFix { 
      mso-table-lspace: -1pt; 
      mso-table-rspace: -1pt; 
     } 
     </style> 
    </head> 
    <body style="margin: 0px; padding: 0px; background-color: #FFFFFF;" bgcolor="#FFFFFF"> 
     <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> 
      <tr> 
       <td align="center"> 
        <div style="max-width:640px !important;"> 
         <table class="msoFix" width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#CCCCCC"> 
          <tr> 
           <td width="290" bgcolor="454545" align="left" style="padding: 0px;"><br>Table 1</td> 
          </tr> 
         </table> 
         <table class="msoFix" width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#EEEEEE"> 
          <tr> 
           <td width="290" bgcolor="959595" align="left" style="padding: 0px;"><br>Table 2</td> 
          </tr> 
         </table> 
        </div> 
       </td> 
      </tr> 
     </table> 
    </body> 
</html> 

回答

0

的解決方案是嵌套在另一個表,並應用cellpaddin =「0」和CELLSPACING兩個表=「0」

您還需要一個條件語句來使表棧上前景,所以你可以保持它的響應。

我已經測試使用石蕊,這工作正常,代碼如下。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <title></title> 
    <style type="text/css"> 
     table td { 
      border-collapse: collapse; 
     } 

     .msoFix { 
      mso-table-lspace: -1pt; 
      mso-table-rspace: -1pt; 
     } 
    </style> 
</head> 
<body style="margin: 0px; padding: 0px; background-color: #FFFFFF;" bgcolor="#FFFFFF"> 
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> 
     <tr> 
      <td align="center"> 

        <table cellspacing="0" cellpadding="0"> 
         <tr> 
          <td> 
           <table class="msoFix" width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#CCCCCC"> 
            <tr> 
             <td width="290" bgcolor="454545" align="left" style="padding: 0px;"><br>Table 1</td> 
            </tr> 
           </table> 
           <!--[if (gte mso 9)|(IE)]> 
      </td> 
      <td valign="top"> 
      <![endif]--> 

           <table class="msoFix" width="320" cellpadding="0" cellspacing="0" align="left" bgcolor="#EEEEEE"> 
            <tr> 
             <td width="290" bgcolor="959595" align="left" style="padding: 0px;"><br>Table 2</td> 
            </tr> 
           </table> 
          </td> 
         </tr> 
        </table> 

      </td> 
     </tr> 
    </table> 
</body> 
</html> 
相關問題