[英]How to add vertical scrollbar to the table sent by python email module?
我有一個很長的 dataframe 由 python email 模塊發送。 我希望它有一個垂直滾動條,以便整個 email 看起來很緊湊。 但我對 HTML 不熟悉,不知道在哪里放置div style="overflow-y: auto;" 部分
以下是 html 代碼。
email_html = """\
<html>
<head>
Dear all, <br>
</head>
<body>
<p>
1.Cash Flow <br>
</p>
<div style="overflow-y: auto;">
{0}
</div>
<p>
Regards,
</p>
</body>
</html>
""".format(table_in_html_format)
它只是像這樣在 email 中生成簡單的普通表,沒有附加滾動條。
提前謝謝你!
也許您應該為該div
設置一個明顯的高度值
email_html = """\
<html>
<head>
Dear all, <br>
</head>
<body>
<p>
1.Cash Flow <br>
</p>
<div style="overflow-y: auto;height:100px">
{0}
</div>
<p>
Regards,
</p>
</body>
</html>
""".format(table_in_html_format)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.