Search code examples
pythonhtmloutlookprettytable

Table borders not showing up in outlook desktop app but is visible in gmail and outlook when opened through browser


I need to send data to users in the form of table in a presentable format. I have the code which does it but unable to find why it doesnt show up on outlook desktop app. How can I work on it to ensure it works on outlook app as well?

I have already tried using hex code and colors like black grey red nothing worked.

table1.get_html_string(attributes={”border-top”:”2px solid #000000"})
print(table1)
<table frame="box" rules="all" border-top="2px solid #000000">
    <tr>

This table when sent over mail prints in table format but skips borders, only over Outlook Desktop App.Works fine over gmail and outlook when opened through browser


Solution

  • border-top works just fine in Outlook. Your css is not valid. Try this instead:

    <table style="border-top: 2px solid #000000;">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
    

    Good luck.