html - Gmail Overriding font-family styles in tables -


for example if have:

<div style="font-family:'trebuchet ms';">     <table cellspacing="0" cellpadding="0">         <tr>             <td>text 1</td>             <td>text 2</td>         </tr>     </table> </div> 

gmail's styles override font-family set in div, if use !important. if try set font right in td elements this:

<div style="font-family:'trebuchet ms';">     <table cellspacing="0" cellpadding="0">         <tr>             <td style="font-family:'trebuchet ms';">text 1</td>             <td style="font-family:'trebuchet ms';">text 2</td>         </tr>     </table> </div> 

gmail strips contents of style attribute completely! same thing happens if try add table element, or span within td element.

though it's not standards-compliant, using font tag allows around this. example:

<div style="font-family:'trebuchet ms';">     <table cellspacing="0" cellpadding="0">         <tr>             <td><font face="trebuchet ms">text 1</font></td>             <td><font face="trebuchet ms">text 2</font></td>         </tr>     </table> </div> 

will work.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -