包装表格数据没有表格布局?

时间:2017-06-01 09:08:07

标签: html html-table html-email

我需要在<td>元素中包装文本,但我不能使用css table-layout属性,因为输出是html电子邮件正文而Outlook不支持{{ 1}}属性。

是否有其他方法可以在table-layout元素中包装文本,还是需要在代码中手动进行换行和测量?

这是我想要实现的一个例子:

<td>
td {
  border: solid black 1pt;
  font-family: arial;
  font-size: 10pt
}

thead td{
  text-align:center;
  font-weight:bold;
}

table {
  border-collapse: collapse
}

2 个答案:

答案 0 :(得分:1)

使用Microsoft专有的word-break:break-all;

<td style="word-break:break-all;"> 

那应该解决问题。

答案 1 :(得分:0)

你可以试试这个:

<tr>
<td nowrap>Never increase, beyond what is necessary, the number of entities required to explain anything</td>
<td>Never increase, beyond what is necessary, the number of entities required to explain anything</td>