Outlook 2013 rendering issue: nested table truncating adjacent text

后端 未结 3 1749
慢半拍i
慢半拍i 2021-02-10 14:02

In developing html email newsletters, I often use a structure similar to the following:

相关标签:
3条回答
  • 2021-02-10 14:37

    Sometimes the accepted solution (adding align= "left" to heading/parent tables) does not work (with multiple nested tables in my case):

    Adding mso-table-rspace to the left aligned table did work:

    <table border="0" cellpadding="0" cellspacing="0" align="left" style="mso-table-lspace:0pt; mso-table-rspace:7pt;">

    0 讨论(0)
  • 2021-02-10 14:45

    Try to set a align left on the heading table, in my code this will work in all clients. Tested in litmus for all clients:

    <table cellspacing="0" cellpadding="0" width="560" align="left" border="0">
    <tbody>
        <tr>
            <td align="left">   
                <table cellspacing="0" cellpadding="0" align="left">
                    <tbody>
                        <tr>
                            <!-- spacer for the top of the image -->
                            <td align="left" colspan="2">
                                <img src="spacer.gif" height="5" alt="spacer" style="display:block; margin:0px; border:0px;" align="left" />
                            </td>
                        </tr>
                        <tr>
                            <!-- the image or text -->
                            <td align="left">
                                <img src="imagesrc" alt="imagealt" style="display:block; margin:0px; border:0px;" />
                            </td>
    
                            <!-- spacer for the right of the image -->
                            <td align="left">
                                <img src="spacer.gif" width="11" alt="spacer" style="display:block; margin:0px; border:0px;" />
                            </td>
                        </tr>
                        <tr>
    
                            <!-- spacer for the bottom of the image -->
                            <td colspan="2" align="left">
                                <img src="spacer.gif" height="11" alt="spacer" style="display:block; margin:0px; border:0px;" />
                            </td>
                        </tr>
                    </tbody>
                </table>
    
                <!-- here your tekst -->
                <div style="margin:0px; padding:0px; mso-line-height-rule: exactly; color:#000000; font-family:Verdana, Arial; font-size:12px; line-height:20px; display:block;">Hello. This is sample text. This is another sentence. Hello. This is sample text.</div>
            </td>
        </tr>
    </tbody>
    </table>
    
    0 讨论(0)
  • 2021-02-10 14:59

    I am not sure what is the problem with Outlook 2013, but you can try to achieve same layout with div structure

    HTML:

    <div class="outer">
      <div class="first">text in the table cell.<br>and another line of text.<br>and a third line.</div>
      <div class="second">Hello. This is sample text. This is another sentence. Hello. This is sample text. This is another sentence. Hello. This is sample text. This is another sentence.</div>
    </div>
    

    CSS:

    .outer {
      width : 50%;
      height : 50%;
      background-color: green;
    }
    
    .first {
      background-color: red;
      float : left;
    }
    
    .second {
      background-color: yellow;
    }
    

    Demo Link

    0 讨论(0)
提交回复
热议问题