Search code examples
html-tableoutlookwidthhtml-email

Outlook 2016: Simple table width in HTML signature not being honored


I am baffled here and I concede that this is probably due to my lack of experience in writing HTML signatures but it's clear that standard html coding goes out the back door when making html signatures...

I am using Outlook 2016 (aka office 365) Version 1808 (Build 10730.20102)

A simple html table code like this is yielding weird results:

<table width="800" height="115">
<tbody>
    <tr>
        <td bgcolor="#000000" valign="top">
            This is some text
        </td>
    </tr>
</tbody></table>

The width of the table is far larger than the 800 pixels specified:

Example of width and height shown

Can anyone help me understand why this is happening and if there is something that I can do to make it render correctly?


Solution

  • You've created a table that's 800 CSS pixels wide, but CSS pixels are not device pixels. CSS pixels are supposed to be 1/96th of an inch (technically, 0.0213 degrees of arc), and the user agent (Outlook) is free to use as many device pixels as that requires.

    In this case, it looks like Outlook is taking its cues from a 150% scaling factor in your display settings. Windows tells Outlook you have a 144dpi display, and Outlook renders a 1200-pixel-wide table. (The height of the table wasn't specified, because height isn't a recognized attribute for <table>s.)