My goal is to ensure that buttons wrap properly inside their cell. I have set a max-width for the cell as well as a ghost table of 200px. The width should not extend past 200px, causing the span
to wrap to the second row automatically. This method works everywhere except for Windows Outlook.
I have also tried using <v:rect>
, but without a defined width, it doesn't work. How can I make sure my list of span
s wraps correctly in Windows Outlook?
<table width="100%" style="border-spacing:0; vertical-align: top;width:100%; max-width:200px;display: inline-block;" role="presentation">
<tr>
<td style="vertical-align: top;font-size: 12px; margin: 0;font-weight:bold;line-height: 20px;white-space: nowrap;-webkit-text-size-adjust: none;">
Area |
</td>
<td style="vertical-align: middle;text-align:left;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" style="border-spacing: 0;" role="presentation">
<tr>
<td width="180" valign="top" style="padding: 0;">
<![endif]-->
<span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;"> </i>
<![endif]-->
AB
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;"> </i>
<![endif]-->
</span>
<span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;"> </i>
<![endif]-->
CDEF
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;"> </i>
<![endif]-->
</span>
<span class="area" style="font-size: 12px;margin: 0;Margin-right:2px;padding: 0 4px;background-color:#8936F3;color:#ffffff;margin-top: 0;line-height: 20px;border-radius: 2px;display: inline-block;text-align: center;white-space: nowrap;-webkit-text-size-adjust: none;">
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%; mso-text-raise: 1pt;"> </i>
<![endif]-->
GHI
<!--[if mso]>
<i style="letter-spacing: 3px; mso-font-width: -100%;mso-text-raise: -1pt;"> </i>
<![endif]-->
</span>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
The expected look can be viewed here: https://i.sstatic.net/LQtFR.png (it displays correctly on Mac OS Outlook and other clients but not Windows Outlook).
However, this is the actual result: https://i.sstatic.net/2IzsV.png