表格边框未在Outlook桌面应用中显示,但通过浏览器打开时在gmail和Outlook中可见。

时间:2019-04-15 12:13:37

标签: python html outlook prettytable

我需要以可展示的格式将数据以表格的形式发送给用户。 我有执行此操作的代码,但无法找到为什么它未显示在Outlook桌面应用程序上的原因。我如何处理它以确保它也可以在Outlook应用程序上使用?

我已经尝试使用十六进制代码和黑色,灰色,红色等颜色,但没有用。

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

通过邮件发送时,此表以表格格式打印,但仅在Outlook Desktop App上跳过边框。通过浏览器打开时,在gmail和Outlook上效果很好

1 个答案:

答案 0 :(得分:0)

border-top在Outlook中可以正常工作。您的CSS无效。尝试以下方法:

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

祝你好运。