Question with ul tags in email displayed in Outlook

I am trying to create an html template that will be sent to users. The problem with the email provided is that the lists are not displayed correctly, the formatting and nested list structure is lost. This issue applies to Outlook, while the formatting is correct in the browser.

I performed the following thread ( Problem with ol and ul tags in email sent with Outlook ) and tried to simulate a list using a table. It works great for a single list. But since I have nested lists, I cannot set up the rendering correctly.

I have followed the following approaches:

<table cellspacing="0" cellpadding="0"> <tr> <td width="20" align="center" valign="top">&bull;</td> <td align="left" valign="top"></td> List Item 1: </td> </tr> <tr> <td></td> // Empty column, since sub-list should be at different level <td> <table cellspacing="0" cellpadding="0"> <tr> <td width="20" align="center" valign="top">&#10004;</td> <td align="left" valign="top"></td> Nested List Item 1: </td> </tr> </table> </td> </tr> </table> 

I also tried nesting the internal list by paying an extra empty column instead of the nested table.

 <table cellspacing="0" cellpadding="0"> <tr> <td width="20" align="center" valign="top">&bull;</td> <td align="left" valign="top"></td> List Item 1: </td> </tr> <tr> <td width="20"></td> // empty column <td width="20" align="center" valign="top">&bull;</td> <td align="left" valign="top"></td> Nested List Item 1: </td> </tr> </table> 

But so far I can’t fix it. Any inputs would be appreciated.

0
source share
1 answer

There are too many closed TDs in the code. In addition, imo, the nested list should go inside the TD item; he nesting, who looks at the code in the future will have a better understanding of how these things are related, if the nested list is inside the TD for the first item.

Here's JSfiddle: https://jsfiddle.net/jabafpts/

And finally, the code:

 <table cellspacing="0" cellpadding="0"> <tr> <td width="20" align="center" valign="top">&bull;</td> <td align="left" valign="top"> List Item 1 <table cellspacing="0" cellpadding="0"> <tr> <td width="20" align="center" valign="top">&#10004;</td> <td align="left" valign="top">Nested List Item 1 </td> </tr> <tr> <td width="20" align="center" valign="top">&#10004;</td> <td align="left" valign="top">Nested List Item 2 </td> </tr> </table> </td> </tr> <tr> <td width="20" align="center" valign="top">&bull;</td> <td align="left" valign="top"> List Item 2</td> </tr> </table> 
+1
source

Source: https://habr.com/ru/post/1441408/


All Articles