Setting a hard "width" it very compatible, but won't squeeze on narrow screens. Setting max-width works well, except in Outlook and Hotmail. We resort to old skool table tricks: a table with width=100%, with 3 columns, only oneof which, the middle one, had content, and a fixed with. This works.
21 lines
630 B
Text
21 lines
630 B
Text
<table style="font-size: 15px; margin: 15px 0px; background-color: #eee; width: 100%">
|
|
<tr>
|
|
<td style="width: 50px; min-width: 50px; vertical-align: top; padding: 15px">
|
|
<%= link_to(
|
|
image_tag(
|
|
attachments["avatar.png"].url,
|
|
alt: @author,
|
|
title: @author,
|
|
width: 50,
|
|
height: 50,
|
|
border: 0
|
|
),
|
|
user_url(@author, :host => SERVER_URL),
|
|
:target => "_blank"
|
|
) %>
|
|
</td>
|
|
<td style="text-align: left; vertical-align: top; padding-right: 10px; width: 100%">
|
|
<%= body %>
|
|
</td>
|
|
</tr>
|
|
</table>
|