开发者

Outlook html signature adds nbsp

开发者 https://www.devze.com 2023-03-13 06:43 出处:网络
We\'re creating html signatures for all the users within our domain, based on a simple html template.

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.


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;"/>

0

精彩评论

暂无评论...
验证码 换一张
取 消