I have following html in email template.
I am getting different view in MS Outlook and in gmail for the same.
<tr>
<td bgcolor="#7d9aaa" style="color: #fff; font-size:15px; font-family:Arial, Helvetica, sans-serif; padding: 12px 2px 12px 0px; ">
<span style="font-weight: bold;padding-right:150px;padding-left: 35px;">Order Confirmation </span>
<span style="font-weight: bold;width:400px;"> Your Confirmation number is {{var order.increment_id}} </span></td>
</tr>
How to fix this?
After doing many tests in Litmus, i could not find a way to have perfect rendering in all emails readers, but here is the better solution i found :
In this piece of code, i aimed to emulate padding : 6px 12px;
There are 2 "12px table columns" that handles the right and left padding.
And I'm using "padding: 6px 0;" on my td content, to manage top and bottom padding : Outlook 2010 and 2013 will ignore this and will use their own padding.
The text won't be perfectly aligned in Outlook 2010 and Outlook 2013 (slightly too far from top) but it works with all other email readers i tried : Apple Mail, Gmail, Outlook 2011 (yes..), Hotmail, Yahoo and many more.
Preview image : Outlook 2010 and 2013 preview
Preview image : Gmail, Apple Mail and others
Do this instead:
It is better to use two cells and align the content, than using large padding and
's.My solution is to use an empty / whichever is needed with a transparent spacer gif since padding isnt 100% supported.
To create HTML in email template that is emailer/newsletter, padding/margin is not supporting on email clients. You can take 1x1 size of blank gif image and use it.
have you tried
display:inline-block;
?All styling including padding have to be added to a td not a span.
Another solution put the text into
<p>text</p>
and define margins, and that should give the required padding.For example: