0

I am trying to create a responsive HTML email. The two columns should be equal height and they currently stack on mobile. Everything works properly until there is a lot of text as the Billing Information or Shipping Information. It's an unlikely case that the text will ever look like this, but I must handle all possibilities without the email breaking. How can I make my td stretch vertically instead of horizontally? I cannot use a fixed width as it will break the responsiveness of my table.

<table align="left" border="0" cellpadding="0" cellspacing="0" class="mcnTextBlock" width="100%">
                                <tbody class="mcnTextBlockOuter">
                                    <tr>
                                        <td valign="top" width="100%" class="mcnTextBlockInner" style="padding-top:9px; padding-right:18px; padding-left: 18px; padding-bottom: 15px;">
                                            <!--[if mso]>
                                            <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
                                            <tr>
                                            <![endif]-->

                                            <!--[if mso]>
                                            <td valign="top" width="600" style="width:600px;">
                                            <![endif]-->
                                            <table align="left" bgcolor="white" border="0" cellpadding="5" cellspacing="0" style="max-width:100%; min-width:100%;" width="100%" class="mcnTextContentContainer">
                                                <tbody>
                                                    <tr>
                                                        <td valign="top"  width="50%" class=" templateColumnContainer"">
                                                            <!--<td valign="top" width="300" class="mcnTextBlockInner" style="padding-top:9px;padding-right:18px;padding-left:18px;padding-bottom:15px;"> -->
                                                            <table border="0" cellpadding="5" cellspacing="0" width="100%" style="max-width:100%; min-width:100%;" class="mcnTextContentContainer">
                                                                <tr>
                                                                    <td valign="top" align="center" class="leftColumnContent" style="text-align: center;" >
                                                                        <span  style="color:#000000; font-size:18px; display: block; width:100%; height:auto;"><strong>Billing Information</strong></span>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td  valign="middle" class="leftColumnContent" style="text-align: center;">
                                                                        <span style="font-size:14px; color: #000000!important;"><a href="" style="color:#000000; text-decoration:none;">{{ receipt.order.get_billing_html|safe }}</a></span>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                      
                                                        <td valign="top" width="50%" class="templateColumnContainer">
                                                            <table border="0" cellpadding="5" cellspacing="0" width="100%">
                                                                <tr>
                                                                    <td class="rightColumnContent"  style="text-align: center;">
                                                                        <span style="font-size:18px; color:#000000; text-align:center; display: block; width:100%; height:auto;"><strong>Shipping Information</strong></span>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td valign="middle" class="rightColumnContent"  style="text-align: center;">
                                                                        <span>
                                                                            <a href="" style="color:#000000;font-size:14px; text-decoration:none;">Shipping Address</a>
                                                                        </span>
                                                                
                                                                            <br><span style="font-size:14px; color: #000000!important;">Shipping speed description
                                                                        {% endif %}
                                                                        {% if receipt.order.shipper_tracking_number %}
                                                                            <br><strong style="color: #000000;!important">Tracking: </strong>Shipper Name</span><br>
                                                                            
                                                                                <a href="shipping tracking number" target="_blank" style="color: #000000; font-size: 14px;">
                                                                                    
                                                                                </a>
                                                                         
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                   
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
morec
  • 27
  • 7

1 Answers1

0

Found the answer in post: HTML CSS How to stop a table cell from expanding

Using style="overflow-wrap: break-word;" on the <td> solved my problem. It is compatible across Gmail, Apple Mail, Yahoo, latest Outlook.

morec
  • 27
  • 7