2015-06-17 86 views
0

我不得不創建電子郵件html,我可以說這絕對是一件很難的事情。現在,確保它的響應速度超出了討厭的程度。 我現在被困在看似無法解決的問題上。在媒體查詢中摺疊表格單元格以發送電子郵件

這裏是問題:我有一個表有3列(第1列是表,第2列是間隔柱,第3列是表)。 當我移動時,我希望第三列進入第1列。但是不管我嘗試什麼,我都無法做到。

請注意顯示參數CANT可以使用。這非常重要。谷歌郵件不知道什麼顯示方式(...) 似乎可以使用的唯一東西是:浮動和對齊。

這裏是我的jsfiddle https://jsfiddle.net/cnw0o3wy/ 跟着我們和聯繫我們單元格在同一張表中;那張桌子必須放在第一張桌子下面。我不能達到現在

   <tr> 
        <td> 
         <table align="center"> 
          <tr> 
           <td class="align-top grey responsive"> 
            <table border="0" cellpadding="0" cellspacing="0" width="307"> 
             <tbody> 
              <tr class="grey"> 
               <td class="align-top"colspan="3"><img alt="" src="images/mobile.png" /></td> 
              </tr> 
              <tr class="grey"> 
               <td width="113" class="w113">&nbsp;</td> 
               <td> 
                <a href="#" title="Apple Store"><img src="images/appstore.png" title="Apple Store" /></a> 
               </td> 
               <td> 
                <a href="#" title="Google Play"><img src="images/googleplay.png" title="Google Play" /></a> 
               </td> 
              </tr> 
             </tbody> 
            </table> 
           </td> 
           <td width="4"class="responsive"> 
           </td> 
           <td class="responsive"> 
            <table border="0" cellpadding="0" cellspacing="0" width="307" class="w307"> 
             <tbody class="grey"> 
              <tr class="grey"> 
               <td class="align-top grey"> 
                <table cellpadding="0" cellspacing="0" width="151" class="w151"> 
                 <tbody class="grey"> 
                  <tr> 
                   <td style="line-height:6px;" height="6" width="151" class="w151">&nbsp;</td> 
                  </tr> 
                  <tr> 
                   <td style="padding-left: 7px;" class="t-gris px12 bold align-top">Follow us !</td> 
                  </tr> 

                  <!-- 32 PX SPACING --> 
                  <tr> 
                   <td height="36" width="151" class="w151"><img src="images/shim.png" alt="" height="31" />&nbsp;</td> 
                  </tr> 

                  <tr class="align-center"> 
                   <td> 
                    <a href="#" title="Facebook"><img class="social" src="images/fb.png" alt="Facebook" /></a> 
                    <a href="#" title="Twitter"><img class="social" src="images/twitter.png" alt="Twitter" /></a> 
                    <a href="#" title="Mail"><img class="social" src="images/mail.png" alt="Mail" /></a> 
                   </td> 
                  </tr> 

                 </tbody> 
                </table> 
               </td> 
               <td class="white"> 
                <img alt="" src="images/shim.png" width="4" /> 
               </td> 

               <td class="align-top grey"> 
                <table cellpadding="0" cellspacing="0" width="151" class="w151"> 
                 <tbody class="grey"> 
                  <tr> 
                   <td style="line-height:6px;" height="6" width="151" class="w151">&nbsp;</td> 
                  </tr> 
                  <tr> 
                   <td style="padding-left: 7px;" class="px12 bold t-gris align-top">Contact us !</td> 
                  </tr> 

                  <tr> 
                   <td><img alt="" src="images/logo2.png" /></td> 
                  </tr> 

                  <tr> 
                   <td style="padding-left: 7px;" class="px10 t-gris bold"> 
                    50/54 <br/>92100 <br/>+33 1 49 00 00 00 www.mail.fr 
                    <span style="text-decoration: underline;"> 
                     [email protected] 
                    </span> 
                   </td> 
                  </tr> 
                  <tr> 
                   <td style="line-height:7px;"height="7" width="151" class="w151">&nbsp;</td> 
                  </tr> 
                 </tbody> 
                </table> 
               </td> 
              </tr> 
             </tbody> 
            </table> 
           </td> 
          </tr> 
         </table> 
        </td> 
       </tr> 
+0

應這項工作的前景? (它最好不應該^^) – cari

+0

我的電子郵件工作已經很好的桌面前景。我只需要移動版本的工作,這意味着主要是Android,因爲它工作正常ios –

+1

真正的表列將永遠不會在另一個相同的級別列。絕對沒有辦法。你沒有找到解決方案,因爲它不存在。唯一的方法是用DIV定義表格並使用'display:table;',但由於你不能使用顯示,所以這是不可能的。 – cari

回答

0

解決我的問題與以下行這種效果:

td[class="responsive-grey"], 
td[class="responsive-grey responsive-grey-spacing"], 
td[class="align-top grey responsive-grey"] { 
    float: left; width:100%; 

} 

基本上左浮動在所有三列

+0

我不知道這是爲什麼,因爲float:left隱式地改變了元素的顯示類型。所以Gmail允許這樣做,但它不允許直接更改顯示?那麼這麼優柔寡斷...... – cari

+0

實際上它的工作原理和我的答案並不完整。您還必須在這些列上指定100%的寬度。但隨後內容向左移動而不居中。所以你必須在子表上放置align =「center」。它100%的作品! –

+0

:-)你騙了谷歌 – cari

相關問題