問題描述
電子郵件的可滾動表(沒有 div) (Scrollable table for e‑mails (without a div))
是否可以創建一個內容可垂直滾動的表格(表格為 600x600)?我知道的唯一方法是使用無法用於電子郵件目的的 div。
參考解法
方法 1:
You can achieve above by using css.By mentioning this you can achieve the result overflow‑Y:scroll (for verticle scroll bar)
table{
overflow‑Y:scroll;
height:600px;
}
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>EMail</th>
</tr>
</table>
方法 2:
I was trying to generate dynamic tables from java code , adding this line of code made the table scrollable inside the email body in Outlook email client.
Embedded Html like so : <div style= 'width:800px; height:400px; overflow:scroll; position:relative;'>
java code looks like :
body.append("<div style= 'width:800px; height:400px; overflow:scroll; position:relative;'>");
body.append("<table border='1' cellpadding='5' cellspacing='0'>");
(by MuchaZ、Renuka CE、Alferd Nobel)