HTML Emails: Center aligning tables affects cell text in Internet Explorer -


i have noticed 'bug' or whatever internet explorer when viewing html emails. i'm using version 11 , still present.

if want align table in center of page, causing text in <td> cells centered, if set attribute align="left" , use inline css specify text-align="left".

here example code (try sending html email yahoo or gmail account , view in ie):

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background:#ccc;">   <tr>     <td>     <table width="650px" border="0" align="center" cellpadding="0" cellspacing="0" style="padding-left:11px;padding-right:11px;background:#fff;">   <tr>     <td align="left" valign="top" style="text-align:left;">moreover, while in other animals can think of, eyes planted imperceptibly blend visual power, produce 1 picture , not 2 brain; peculiar position of whale's eyes, effectually divided many cubic feet of solid head, towers between them great mountain separating 2 lakes in valleys; this, of course, must wholly separate impressions each independent organ imparts.<br><br> whale, therefore, must see 1 distinct picture on side, , distinct picture on side; while between must profound darkness , nothingness him. man may, in effect, said out on world sentry-box 2 joined sashes window. whale, these 2 sashes separately inserted, making 2 distinct windows, sadly impairing view. peculiarity of whale's eyes thing borne in mind in fishery; , remembered reader in subsequent scenes.</td>   </tr> </table>     </td>   </tr> </table> 

you should see text center aligned rather left aligned. 'bug' present when viewing code html email. if view webpage works fine!

i have tested using web versions of outlook , yahoo different online mail account , problem same in ie. tried in chrome, firefox, , android's built-in browser , works fine.

i don't understand how fix other not have tables centered in middle of page. doesn't aesthetically pleasing have email contents left of page either.

instead of using align="center" in parent table tag, try putting in parent <td>. lose align="center" on child table tag, , don't need css text-align:

<table bgcolor="#cccccc" width="100%" border="0" cellpadding="0" cellspacing="0">   <tr>     <td align="center">       <table bgcolor="#ffffff" width="650px" border="0" cellpadding="0" cellspacing="0">         <tr>           <td align="left" valign="top" style="padding-left:11px; padding-right:11px;">             text here...           </td>         </tr>       </table>     </td>   </tr> </table> 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -