Monday, December 9th, 2013

Fixing the forced body padding in Outlook 2007, 2010 and 2013

Testing a html email recently with a high percentage of recipients likely to be users of Microsoft Outlook I came across a bug where it’s not possible to overwrite the forced body padding in versions of outlook (which use MS Words rendering engine 2007, 2010, 2013).

This was breaking the design and causing unwanted whitespace on the left margin of the email. The offending versions of outlook support margin (including negative margin) but only support inline styles.┬áSo the fix/hack is to wrap the entire email in a wrapper table and apply negative margin to just the problematic email clients – using html ‘if statements’ as below.

<!--[if !gte mso 9]><!---->
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<!--[if gte mso 9]>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-left:-10px;">
    <!-- YOUR CONTENT HERE -->

One Response to “Fixing the forced body padding in Outlook 2007, 2010 and 2013”

  1. Steven says:

    Problem with this method is that it pushes your 100% wide table to the left by 10px leaving 10px of white space on the right.

Leave a Reply