Outlook html 签名添加 nbsp
我们正在基于简单的 html 模板为域内的所有用户创建 html 签名。
...
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Tel%></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Mobile%></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Fax%></td>
</tr>
...
占位符将替换为用户的实际号码。
以下几行是生成的签名的一部分,其中包含电话号码、手机号码和传真号码。如果用户没有手机号码,则第二个 tr-td 为空:
...
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;">T +123 456 789</td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;">F +123 456 789</td>
</tr>
...
当将一行留空时(如第二行),html 在现代浏览器中呈现得很好,确保电话和传真行靠近。
但是,一旦我将此模板添加到 Outlook 2003 中,Outlook 就会添加一个额外的“nbsp;”到 html,在空的 td 标签之间。这会导致电话号码和传真号码之间显示全空行。
显然,用户对这条多余的线很恼火,并且懒得每次都手动删除多余的线。签名是只读,因此无法在设置中更改它。
关于为什么会发生这种情况以及如何解决这个问题有什么想法吗?
编辑:抱歉,Outlook版本实际上是2003年,而不是2010年。
We're creating html signatures for all the users within our domain, based on a simple html template.
...
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Tel%></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Mobile%></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"><%Fax%></td>
</tr>
...
The placeholders are replaced with the actual numbers for a user.
The following lines are a part of the generated signature, with telephone, mobile and fax numbers. If a user has no mobile number, the second tr-td is empty:
...
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;">T +123 456 789</td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;"></td>
</tr>
<tr>
<td colspan="3" style="font-style:normal; font-size:12px;">F +123 456 789</td>
</tr>
...
When leaving a line empty ( like in the second line ) the html renders just fine in modern browsers, making sure the Tel and the Fax line are close together.
However, once I add this template to Outlook 2003, Outlook adds an extra 'nbsp;' to the html, between the empty td-tags. This results in an full empty line being shown between the tel and fax number.
Obviously, the user is annoyed with this extra line and cannot be bothered to remove the extra line manually each time. The signatures are read-only, so changing it in the settings is not an option.
Any ideas on why this happens, and how to fix this?
Edit: Apologies, Outlook version actually is 2003, not 2010.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定这是否有效,但值得一试。您是否尝试过像这样关闭标签:
Not sure if this will work but it's worth a shot. Have you tried just closing the tag like so:
<td colspan="3" style="font-style:normal; font-size:12px;"/>