Skip to content

Instantly share code, notes, and snippets.

@jamesmacwhite
Created September 18, 2014 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmacwhite/ddb075abde1de7d384ff to your computer and use it in GitHub Desktop.
Save jamesmacwhite/ddb075abde1de7d384ff to your computer and use it in GitHub Desktop.
CSS inheritance on table cells in Outlook desktop clients
<!--
CSS inheritance on table cells in Outlook
Applying CSS to a table cell that has two or more cells within the same table will cause some CSS
to be applied to all of the table cells in Outlook desktop clients.
-->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" style="padding-bottom:5px;">Cell 1 with 5px padding on the bottom</td>
<td align="left" valign="top">Cell 2 will also get 5px padding on the bottom</td>
</tr>
</table>
<!-- To avoid this, you have to nest a table and apply it to the inner table cell instead -->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" style="padding-bottom:5px;">Cell 1 with 5px padding on the bottom</td>
</tr>
</table>
</td>
<td align="left" valign="top">Cell 2 doesn't get padding!</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment