Created
September 18, 2014 20:42
-
-
Save jamesmacwhite/ddb075abde1de7d384ff to your computer and use it in GitHub Desktop.
CSS inheritance on table cells in Outlook desktop clients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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