python - HTML tables won't align properly in Outlook -
i trying attach html code outlook email via python. question surrounding html , outlook. trying use code below , make 2 tables aligned vertically. when have html code works fine, when mail outlook tables 1 on top of each other. thoughts on why happening.
<html> <head> <title>tester</title> </head> <body> <table> <table style="border:1px solid black;border-collapse:collapse;float:left;margin:10px"> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">first</th> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">last</th> <tr bgcolor="#ffffff" style ="height:23px;"> <td style="border:1px solid black;padding:3px" align="left"><code> </code></td> <td style="border:1px solid black;padding:3px" align="right"><code> </code></td> </tr> <tr bgcolor="#ffffff"> <td style="border:1px solid black;padding:3px" align="left"><code>bob</code></td> <td style="border:1px solid black;padding:3px" align="left"><code>smith</code></td> </tr> </table> <table> <table style="border:1px solid black;border-collapse:collapse;float:left;margin:10px"> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">first</th> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">last</th> <tr bgcolor="#ffffff" style ="height:23px;"> <td style="border:1px solid black;padding:3px" align="left"><code> </code></td> <td style="border:1px solid black;padding:3px" align="right"><code> </code></td> </tr> <tr bgcolor="#ffffff"> <td style="border:1px solid black;padding:3px" align="left"><code>stevev</code></td> <td style="border:1px solid black;padding:3px" align="left"><code>clarck</code></td> </tr> </table> </body> </html>
your syntax bad on lines 10 & 11 , 24 & 25. try following , let me know if works better.
<html> <head> <title>tester</title> </head> <body> <table width="100%"> <tr> <td> <table style="border:1px solid black;border-collapse:collapse;float:left;margin:10px"> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">first</th> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">last</th> <tr bgcolor="#ffffff" style ="height:23px;"> <td style="border:1px solid black;padding:3px" align="left"><code> </code></td> <td style="border:1px solid black;padding:3px" align="right"><code> </code></td> </tr> <tr bgcolor="#ffffff"> <td style="border:1px solid black;padding:3px" align="left"><code>bob</code></td> <td style="border:1px solid black;padding:3px" align="left"><code>smith</code></td> </tr> </table> </td> <td> <table style="border:1px solid black;border-collapse:collapse;float:left;margin:10px"> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">first</th> <th style="border:1px solid black;padding:3px" bgcolor="#dddddd" align="left">last</th> <tr bgcolor="#ffffff" style ="height:23px;"> <td style="border:1px solid black;padding:3px" align="left"><code> </code></td> <td style="border:1px solid black;padding:3px" align="right"><code> </code></td> </tr> <tr bgcolor="#ffffff"> <td style="border:1px solid black;padding:3px" align="left"><code>stevev</code></td> <td style="border:1px solid black;padding:3px" align="left"><code>clarck</code></td> </tr> </table> </td> </tr> </table> </body> </html>
Comments
Post a Comment