I created an email template, where I kept my layout width at 600px.
There are four columns of 150px width each.
It is working fine on all clients except with Outlook, where the layout breaks because of an unwanted column spacing.
I didn't use any explicit padding though.
Here is how it look-like in Outlook:
Any kind of help would be very appreciated.
<tr>
<td align="left" style="-moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; border-collapse: collapse; color: #4e5054; font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif; font-size: 12px; font-smoothing: antialiased; font-weight: normal; line-height: 18px; margin: 0; padding: 0; vertical-align: top; padding-bottom:0;">
<!-- stat -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e5e5e5">
<tr>
<td align="center" style="padding-top:20px; padding-bottom:20px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="display:block; max-width:600px;" class="wrapto680px">
<tr>
<td width="100%" valign="top" align="center" style="text-align:center; font-size:0px;">
<!--[if (gte mso 9)|(IE)]><table width="600" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" width="600"><![endif]-->
<div style="display:inline-block;" class="ecxmarginhack">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="100%" valign="top">
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</table>
<!-- end 4 col --></td>
</tr>
</table>
<!-- End -->
</td>
</tr>
Coding tables as columns gets a little fiddly when it comes to outlook. By default when two tables are placed right beside each other, outlook adds space on the right. Here you have two options: 1. Go with ghost columns (personal favorite) or 2. Reduce table widths (and image widths) by a few pixels and add a style to tables (style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;").
Option 1: Ghost Columns
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" style="-moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; border-collapse: collapse; color: #4e5054; font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif; font-size: 12px; font-smoothing: antialiased; font-weight: normal; line-height: 18px; margin: 0; padding: 0; vertical-align: top; padding-bottom:0;"><!-- stat -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e5e5e5">
<tr>
<td align="center" style="padding-top:20px; padding-bottom:20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="display:block; max-width:600px;" class="wrapto680px">
<tr>
<td width="100%" valign="top" align="center" style="text-align:center; font-size:0px;"><!--[if (gte mso 9)|(IE)]><table width="600" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" width="600"><![endif]-->
<div style="display:inline-block;" class="ecxmarginhack">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="100%" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]></td><td><![endif]-->
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]></td><td><![endif]-->
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]></td><td><![endif]-->
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table></td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--></td>
</tr>
</table>
<!-- end 4 col --></td>
</tr>
</table>
<!-- End --></td>
</tr>
</tbody>
</table>
Option 2: Style on tables
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" style="-moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; border-collapse: collapse; color: #4e5054; font-family: 'Verdana', 'Arial', 'Helvetica', sans-serif; font-size: 12px; font-smoothing: antialiased; font-weight: normal; line-height: 18px; margin: 0; padding: 0; vertical-align: top; padding-bottom:0;"><!-- stat -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e5e5e5">
<tr>
<td align="center" style="padding-top:20px; padding-bottom:20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="display:block; max-width:600px;" class="wrapto680px">
<tr>
<td width="100%" valign="top" align="center" style="text-align:center; font-size:0px;"><!--[if (gte mso 9)|(IE)]><table width="600" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" width="600"><![endif]-->
<div style="display:inline-block;" class="ecxmarginhack">
<table width="600" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="100%" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table>
<table width="150" border="0" cellspacing="0" cellpadding="0" align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<td style="font-size:0px;"><img style="display:block;" border="0" src="http://www.stevensegallery.com/200/200" width="150" height="150" alt=""/></td>
</tr>
</table></td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]--></td>
</tr>
</table>
<!-- end 4 col --></td>
</tr>
</table>
<!-- End --></td>
</tr>
</tbody>
</table>
Hope this is the answer you were after.
Seems like a lot of unnecessary code. I would suggest using a much simpler code:
<div style="width: 600px; display: flex;">
<img style="border:0; width: 150px; height: 150px;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px;" src="http://www.stevensegallery.com/200/200" alt=""/>
</div>
Another option without using flex
<div style="width: 600px;">
<img style="border:0; width: 150px; height: 150px; float: left;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px; float: left;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px; float: left;" src="http://www.stevensegallery.com/200/200" alt=""/>
<img style="border:0; width: 150px; height: 150px; float: left;" src="http://www.stevensegallery.com/200/200" alt=""/>
</div>
Related
Running into my regular struggles with email template designs, in particular that Gmail removes classes and thus I can't center a td via any means. Is there any way at all to change the "align" from left to center on the td with the image? Maybe I can comment in additional TDs on sides to center it, if Gmail permits it. I'm at a loss.
Template is mildly frankensteined from a template block editor.
<table class="row" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" width="280" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td align="left">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td align="left">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; width:auto !important;" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td class="img-responsive" width="280" align="left">
<img alt="280x200x1" src="#" style="width:100%; height:auto;" width="280" height="200">
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td align="center">
<table data-primary-order="1" data-primary-type="bgcolor" data-bgcolor="Columns" width="100%" cellspacing="0" cellpadding="0" bgcolor="#f6f6f6" align="center">
<tbody><tr>
<td align="center">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; max-width:90%; width:90%;" width="90%" cellspacing="0" cellpadding="0" align="center">
<tbody><tr>
<td style="mso-line-height-rule: exactly; line-height:15px; font-size:0;" height="15"> </td>
</tr>
<tr>
<td>
<table style="width:auto !important;" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td data-color="Titles" data-size="Titles" data-min="14" data-max="46" style="color: #333333; font-family: 'roboto', Arial, Helvetica, sans-serif; font-weight: 400; font-size: 13px; line-height: 22.1px;" align="left">text text<br>text text</td></tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="mso-line-height-rule: exactly; line-height:15px; font-size:0;" height="15"> </td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
I believe the following code should resolve your issue. When viewing the code you will see there is an element with an id of "I CHANGED FROM LEFT TO CENTER". This seemed to cause the issue, hopefully it works for you too!
<!DOCTYPE html>
<html>
<body>
<table class="row" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" width="280" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td align="left">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td align="left">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; width:auto !important;" cellspacing="0" cellpadding="0" align="left">
<tbody><tr>
<td class="img-responsive" width="280" align="left">
<img alt="280x200x1" src="#" style="width:100%; height:auto;" width="280" height="200">
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td align="center">
<table data-primary-order="1" data-primary-type="bgcolor" data-bgcolor="Columns" width="100%" cellspacing="0" cellpadding="0" bgcolor="#f6f6f6" align="center">
<tbody><tr>
<td align="center">
<table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; max-width:90%; width:90%;" width="90%" cellspacing="0" cellpadding="0" align="center">
<tbody><tr>
<td style="mso-line-height-rule: exactly; line-height:15px; font-size:0;" height="15"> </td>
</tr>
<tr>
<td>
<table style="width:auto !important;" cellspacing="0" cellpadding="0" align="center" id="I CHANGED FROM LEFT TO CENTER">
<tbody><tr>
<td data-color="Titles" data-size="Titles" data-min="14" data-max="46" style="color: #333333; font-family: 'roboto', Arial, Helvetica, sans-serif; font-weight: 400; font-size: 13px; line-height: 22.1px;" style="text-align: right;">text text<br>text text</td></tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="mso-line-height-rule: exactly; line-height:15px; font-size:0;" height="15"> </td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</body>
</html>
SOLVED: Needed to declare a height on the main image that is nested in the table.
QUESTION: I have two tables that I'm trying to stack on top of one another in an html email but am getting a gap between them in Outlook 2016 only. The red box should touch the grey horizontal line. See picture below. All other version of Outlook are good. I've removed cell padding, borders, and spacing from all tables so I'm at a loss on this one. I also have this table aligned top. Any tricks to getting this to work in MSO 2016?
<table align="right" width="190" border="0" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt; mso-table-rspace:0pt; margin: 0 auto; border-collapse:collapse;" bgcolor="#6e7171">
<tr>
<td align="center" width="1">
<!-- margin SPACER-->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tr>
<td width="1" height="1" style="mso-line-height-rule:exactly; line-height:1px; font-size:0;">
<img src="images/sp.gif" width="1" height="1" alt="" border="0" style="display:block;" />
</td>
</tr>
</table>
<!-- /margin SPACER-->
</td>
<td align="center" bgcolor "#6e7171" class="hideMobile" width="188" align="left" class="outlookpadding" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tr>
<td width="1" height="1" style="mso-line-height-rule:exactly; line-height:1px; font-size:0;">
<img src="images/sp.gif" width="1" height="1" alt="" border="0" style="display:block;" />
</td>
</tr>
</table>
<table class="hideMobile" bgcolor "#6e7171" align="center" width="188" border="0" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt; mso-table-rspace:0pt; margin: 0 auto; border-collapse:collapse; margin: 0 auto;">
<tr>
<td align="center">
<table width="188" cellpadding="0" class="deviceWidth" cellspacing="0" border="0" bgcolor="#ffffff" align="center" style="border-collapse: collapse;">
<tr>
<td>
<a target="_blank" href="#"><img src="images/laptop.jpg" alt="Using laptop trackpad" width="190" style="display: block; width: 190px; " align="center"></a>
</td>
</tr>
<tr>
<td class="showMobile hideyahoo" valign="top" align="right" bgcolor="#ffffff" style="display: block; text-align: left; font-size: 14px; line-height: 18px; font-family:Arial, Helvetica, sans-serif;color:#e51b3f; mso-line-height-rule: exactly; padding-right: 10px; padding-left: 10px; padding-top: 18px; font-weight: bold;">Ask the right questions.</td>
</tr>
<tr>
<td class="showMobile hideyahoo" valign="top" align="right" display="block" bgcolor="#ffffff" style="text-align: left; font-size: 13px; line-height: 18px; font-family:Arial, Helvetica, sans-serif;color:#514d4d; mso-line-height-rule: exactly; padding-right: 10px; padding-left: 10px; padding-bottom: 15px; padding-top: 15px; ">Having an honest discussion with your doctor can help you take a more active role in your care. These conversation starters can help you know what to ask.</td>
</tr>
</table>
</td>
<td width="1">
<!-- margin -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tr>
<td width="1" height="1" style="mso-line-height-rule:exactly; line-height:1px; font-size:0;">
<img src="images/sp.gif" width="1" height="1" alt="" border="0" style="display:block;" />
</td>
</tr>
</table>
<!-- /margin -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tr>
<td width="1" height="1" style="mso-line-height-rule:exactly; line-height:1px; font-size:0;">
<img src="images/sp.gif" width="1" height="1" alt="" border="0" style="display:block;" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table align="right" valign="top" border="0" cellspacing="0" cellpadding="0" bgcolor="#ed1849" height="49" width="192" style="padding: 0; height: 49px; margin: 0 auto; border-collapse: collapse; display">
<tr>
<td style="padding-left: 10px;" height="44">
<table valign="top" border="0" cellspacing="0" cellpadding="0" bgcolor="#ed1849" height="44" style="border-collapse: collapse;">
<tr>
<td border="0" cellspacing="0" cellpadding="0" width="100%" align="center" valign="bottom" style="text-align: left; color: #ffffff; background-color: #ed1849; font-family:Arial, Helvetica, sans-serif; font-weight: bold; font-size: 13px; mso-line-height-rule: exactly;">GET QUESTIONS</td>
</tr>
<tr>
<td border="0" cellspacing="0" cellpadding="0" bgcolor="#ed1849">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#ed1849">
<tr>
<td border="0" cellspacing="0" cellpadding="0" align="center" valign="middle" style="text-align: left; color: #ffffff; background-color: #ed1849; font-family:Arial, Helvetica, sans-serif; font-weight: bold; font-size: 13px; mso-line-height-rule: exactly;">FOR YOUR DOCTOR</td>
<td height="11" bgcolor="#ed1849" align="left" valign="middle" style="padding-left: 7px; vertical-align: middle; font-size: 0;"><img valign="middle" width="8" height="11" style=" display: block; width: 8px; height:11px;" src="images/arrow.jpg" alt="arrow"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Have your tried using conditional comments?
For Outlook 2016 it should be something like the following:
<!--[if mso 16]>some outlook 2016 only stuff<![endif]-->
I am working with the new responsive templates in dotmailer and all elements are now block tables, there are no multi-column tables. I want to stack a right table element over a left table element in a responsive environment while keeping the left/right arrangement on the desktop.
Here is the code for the full element I am working in
I have tried creating the element as a table with columns but cannot save the file when I do that, I have tried css with floats on table ids, the tables, td, and inline css, some of this configurations would flip the order on desktop not a phone. (I am looking specificaly at iphone6)
Is it possible to flip the stacking on block elements?
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%" class="row two-cols ee_columns ee_element" ee-type="container" data-title="2 columns" style="position: relative; background-color: rgb(174, 184, 194);">
<tbody>
<tr>
<td align="center" valign="top" class="row-inner f-size-0 element-pad" dir="ltr" style="padding: 0px 10px 0px 0px;"><!--[if mso]><table border="0" cellspacing="0" cellpadding="0" align="center" style="width:650px;" width="650" class="mso-table-width"><tr><td align="left" valign="top" style="width:331px;" width="320" class="mso-column-width"><![endif]-->
<!-- STACK COLUMN : BEGIN -->
<div class="stack-column stack-column-width" ee-percent-width="51" style="max-width: 50.92%; min-width: 331px; width: 650px;" id="right-stack">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="stack_bottom">
<tbody>
<tr>
<td dir="rlt" class="col-inner ee_dropzone" align="left"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="col-font-reset ee_element" ee-type="element">
<tbody>
<tr>
<td align="left" class="element-pad element-bord" style="padding: 0px;"><img src="img" alt="" style="width: 100%; display: block; height: auto;" class="ee_editable vedpw331" ee-width="331" border="0" width="331" /></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!-- STACK COLUMN : END -->
<!--[if mso]></td><td align="left" valign="top" style="width:325px;" width="325" class="column"><![endif]-->
<!-- STACK COLUMN : BEGIN -->
<div class="stack-column stack-column-width" ee-percent-width="49" style="max-width: 49.07%; min-width: 319px; width: 650px;" id="left-stack">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="stack_top">
<tbody>
<tr>
<td dir="ltr" class="col-inner ee_dropzone" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="ee_element ee_spacer col-font-reset" ee-type="element">
<tbody>
<tr>
<td style="font-size: 1px; line-height: 1px;"><img src="https://i.emlfiles.com/cmpimg/t/s.gif" style="display: block; width: 1px; height: 10px;" alt="" class="" border="0" width="1" height="10" /></td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" class="col-font-reset ee_element" width="100%" ee-type="element">
<tbody>
<tr>
<td valign="top" align="left" class="element-pad element-bord"><div class="ee_editable">
<p class="h3" style="text-align: left; font-size: 17px; color: rgb(255, 255, 255); line-height: 120%;"><b>Headline</b></p>
</div></td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" class="col-font-reset ee_element" width="100%" ee-type="element">
<tbody>
<tr>
<td valign="top" align="left" class="element-pad element-bord"><div class="ee_editable">
<p style="font-size: 14px; color: rgb(255, 255, 255); line-height: 120%;" class="col-text">Text elements here</p>
</div></td>
</tr>
</tbody>
</table>
<table style="max-width: 100%; position: relative; table-layout: auto;" class="row one-cols ee_columns ee_element" ee-type="container" data-title="Columns" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td class="row-inner f-size-0 element-pad col-inner" valign="top" align="center"><!--[if mso]><table border="0" cellspacing="0" cellpadding="0" align="center" style="width:319px;" width="319" class="mso-table-width"><tr><td align="left" valign="top" style="width:319px;" width="330" class="mso-column-width"><![endif]-->
<!-- STACK COLUMN : BEGIN -->
<div class="no-stack-column no-stack-column-width" ee-percent-width="100">
<table style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td dir="ltr" class="col-inner ee_dropzone" align="left"><table style="max-width: 100%; position: relative; table-layout: auto;" class="row one-cols ee_columns ee_element" ee-type="container" data-title="Columns" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td style="padding-top: 0px;padding-right: 20px;padding-bottom: 0px;padding-left: 20px;" class="row-inner f-size-0 element-pad col-inner" valign="top" align="center"><!--[if mso]><table border="0" cellspacing="0" cellpadding="0" align="center" style="width:279px;" width="279" class="mso-table-width"><tr><td align="left" valign="top" style="width:279px;" width="290" class="mso-column-width"><![endif]-->
<!-- STACK COLUMN : BEGIN -->
<div class="no-stack-column no-stack-column-width" ee-percent-width="100">
<table style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td dir="ltr" class="col-inner ee_dropzone" align="left"><table class="ee_element ee_spacer col-font-reset" ee-type="element" style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="font-size: 1px; line-height: 1px;"><img src="https://i.emlfiles.com/cmpimg/t/s.gif" style="display: block; width: 1px; height: 20px;" alt="" class="" width="1" border="0" height="20" /></td>
</tr>
</tbody>
</table>
<table style="max-width: 100%; position: relative; table-layout: auto;" class="row one-cols ee_columns ee_element" ee-type="container" data-title="Columns" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td style="padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;" class="row-inner f-size-0 element-pad col-inner" valign="top" align="center"><!--[if mso]><table border="0" cellspacing="0" cellpadding="0" align="center" style="width:279px;" width="279" class="mso-table-width"><tr><td align="left" valign="top" style="width:279px;" width="290" class="mso-column-width"><![endif]-->
<!-- STACK COLUMN : BEGIN -->
<div class="no-stack-column no-stack-column-width" ee-percent-width="100">
<table style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="background-color: rgb(218, 222, 227);" dir="ltr" class="col-inner ee_dropzone" align="left"><table class="col-font-reset ee_element" ee-type="element" style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="element-pad element-bord" valign="top" align="left"><div class="ee_editable">
<p style="margin: 0px; text-align: center; font-size: 17px; color: rgb(83, 169, 172);"><b>Text Button</b></p>
</div></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!-- STACK COLUMN : END -->
<!--[if mso]></td></tr></table><![endif]--></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!-- STACK COLUMN : END -->
<!--[if mso]></td></tr></table><![endif]--></td>
</tr>
</tbody>
</table>
<table class="ee_element ee_spacer col-font-reset" ee-type="element" style="table-layout: auto;" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="font-size: 1px; line-height: 1px;"><img src="https://i.emlfiles.com/cmpimg/t/s.gif" style="display: block; width: 1px; height: 10px;" alt="" class="" width="1" border="0" height="10" /></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!-- STACK COLUMN : END -->
<!--[if mso]></td></tr></table><![endif]--></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</div>
<!-- STACK COLUMN : END -->
<!--[if mso]></td></tr></table><![endif]--></td>
</tr>
</tbody>
</table>
There are a couple of ways of achieving this:
Method 1: I've found that the simplest way to achieve a reverse stack in email is to code your two columns into <th> tags, then with a class style the header cells to display as table-footer and table-header respectively.
<style>
#media only screen and (max-width: 580px) {
.w320{ width:320px; }
.thg{ display: table-header-group !important; width:100% !important; font-weight:normal;}
.tfg{ display: table-footer-group !important; width:100% !important; font-weight:normal;}
}
</style>
</head>
<body>
<div align="center">
<table width="600" border="0" cellspacing="0" cellpadding="0" class="w320" bgcolor="#333333">
<tr>
<th class="tfg" bgcolor="#CCCCCC">
<table width="100%" class="w320" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>left</td>
</tr>
</table>
</th>
<th class="thg" bgcolor="#999999">
<table width="100%" class="w320" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>right</td>
</tr>
</table>
</th>
</tr>
</table>
</div>
Method 2: If keeping your content in block tables is important to you then you could use the below method. The tables are declared with the right table before the left and reordered using the direction style. This method will require VML to keep then inline on Outlook 2007, 10 and 13.
<style>
#media only screen and (max-width: 580px) {
.w320{ width:320px; }
}
</style>
</head>
<body>
<div align="center">
<table width="600" border="0" cellspacing="0" cellpadding="0" class="w320">
<tr>
<td style="direction:rtl">
<!--[if gte mso 9]>
<table border="0" cellpadding="0" cellspacing="0" style="direction:rtl">
<tr>
<td valign="top">
<![endif]-->
<table width="280" class="w320" border="0" cellspacing="0" cellpadding="0" style="display:inline" bgcolor="#CCCCCC">
<tr>
<td>right</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
<td valign="top">
<![endif]-->
<table width="280" class="w320" border="0" cellspacing="0" cellpadding="0" style="display:inline" bgcolor="#999999">
<tr>
<td>left</td>
</tr>
</table>
<!--[if gte mso 9]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</div>
</body>
I am editing a MailChimp newsletter template and am having an issue removing some padding (see image).
I have removed some padding from this line of code:
<td valign="top" class="headerContainer" style="padding-top:0px; padding-bottom:10px;">
but this does not affect the content as the padding seems to be generated by element.style when the page loads.
Full code for the header section is below.
How can I remove the padding?
<!-- BEGIN HEADER // -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateHeader">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="600" class="templateContainer">
<tr>
<td valign="top" class="headerContainer" style="padding-top:0px; padding-bottom:10px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnImageBlock">
<tbody class="mcnImageBlockOuter">
<tr>
<td valign="top" style="padding:0px" class="mcnImageBlockInner">
<table align="left" width="100%" border="0" cellpadding="0" cellspacing="0" class="mcnImageContentContainer">
<tbody><tr>
<td class="mcnImageContent" valign="top" style="padding-right: 0px; padding-left: 0px; padding-top: 0; padding-bottom: 0; text-align:center;">
<img align="left" alt="" src="https://gallery.mailchimp.com/4ca693f814be731ac4d5dc5f0/images/490a75b1-274d-421a-bd88-ef1c23165352.png" width="140" style="max-width:140px; padding-bottom: 0; display: inline !important; vertical-align: bottom;" class="mcnImage">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // END HEADER -->
Below is the code I have created. When a client opens the email on their end in Outlook 2010 The table width is changed from 356 to width="445" style="width:267.0pt
I have tried to change the below code to include the style width info but that didn't help. On the receive end the width was still changed to 445.
This is what is added specifically to the tables
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="445" style="width:267.0pt">
This is my original code
<HTML><HEAD>
</HEAD>
<BODY style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Verdana" background="">
<table id="Table2" width="356" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<p align=center>
<i><font face="Calibri" style="" color=#1f497d size="3">Click on my
business card and its tabs to learn more.<br><br>
</font></i></td>
</tr>
<tr>
<td>
<table id="Table3" width="356" height="37" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="http://www.wfasignatures.com/wayne.osher/Tab_1.php">
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_01.jpg" width="119" height="37" style=display:block alt="What’s Going on in Your Life?"></a></td>
<td>
<a href="http://www.wfasignatures.com/wayne.osher/Tab_2.php">
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_02.jpg" width="118" height="37" style=display:block alt="Investment Tools & Insights"></a></td>
<td>
<a href="http://www.wfasignatures.com/wayne.osher/Tab_3.php">
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_03.jpg" width="119" height="37" style=display:block alt="Make an Introduction"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_04.jpg" width="356" height="104" style=display:block alt=""></td>
</tr>
<tr>
<td>
<table id="Table4" width="356" height="101" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_05.jpg" width="11" height="101" style=display:block alt=""></td>
<td>
<img border="0" src="http://saf.wellsfargoadvisors.com/faphotos/Photos/68/373868.jpg" width="81" height="101" style=display:block alt=""></td>
<td>
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_07.jpg" width="264" height="101" style=display:block alt=""></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<a href="http://home.wellsfargoadvisors.com/wayne.osher&cid=FA110031909">
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_08.jpg" width="356" height="131" style=display:block alt="Visit my webpage"></a></td>
</tr>
<tr>
<td>
<img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_09.jpg" width="356" height="34" style=display:block alt="Add me to your Contacts"></td>
</tr>
</table></BODY></HTML>
You need to clean up your code a bit and add a few Outlook fixes I think.
in your head add the following code:
<style type="text/css">
.ReadMsgBody, .ExternalClass { width: 100%;}
.ExternalClass * {line-height: 110%;}
body { width: 100% !important; -webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%; margin: 0; padding: 0; }
table { border-collapse:collapse !important;
mso-table-lspace:0pt; mso-table-rspace:0pt; }
</style>
This will fix a number of known rendering issues.
close off your p tags. You seem to open them but not close them in your code. In fact, just avoid p tags altogether. Add your styles directly to the td and place your text straight inside
add quote marks around your style="diplay:block" on your images
add a doctype at the very top of the file: <!DOCTYPE html>
don't have line breaks between img and a tags inside the td
put a table around the whole email at 100% width:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.ReadMsgBody, .ExternalClass { width: 100%;}
.ExternalClass * {line-height: 110%;}
body { width: 100% !important; -webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%; margin: 0; padding: 0; }
table { border-collapse:collapse !important;
mso-table-lspace:0pt; mso-table-rspace:0pt; }
</style>
</head>
<body bgcolor="#ffffff" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" style="margin:0; padding:0;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="356" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="font-family:Calibri; color:#1f497d; font-size:3; font-style:italic; padding:0 0 15px 0;">Click on my business card and its tabs to learn more.</td>
</tr>
<tr>
<td align="left" valign="top"><table id="Table3" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_01.jpg" width="119" height="37" style="display:block;" alt="What’s Going on in Your Life?"></td>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_02.jpg" width="118" height="37" style="display:block" alt="Investment Tools & Insights"></td>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_03.jpg" width="119" height="37" style="display:block" alt="Make an Introduction"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_04.jpg" width="356" height="104" style="display:block;" alt=""></td>
</tr>
<tr>
<td align="left" valign="top"><table id="Table4" width="356" height="101" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_05.jpg" width="11" height="101" style="display:block;" alt=""></td>
<td align="left" valign="top"><img border="0" src="http://saf.wellsfargoadvisors.com/faphotos/Photos/68/373868.jpg" width="81" height="101" style="display:block;" alt=""></td>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_07.jpg" width="264" height="101" style="display:block;" alt=""></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_08.jpg" width="356" height="131" style="display:block;" alt="Visit my webpage"></td>
</tr>
<tr>
<td align="left" valign="top"><img border="0" src="http://www.wfasignatures.com/wayne.osher/wayne.osher_1_09.jpg" width="356" height="34" style="display:block;" alt="Add me to your Contacts"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>