SFR.fr and horizontal alignment

Readers, I prefer to warn you: this article will be exceptionally... short. I'm going to address here mainly to the email coders and campaign testers. A few months ago, I had noticed during email preview tests that SFR.fr had updated their HTML code interpretation (at least it seems to me). Some properties were not correctly interpreted by the webmail in question. The most important one I think is (and also because I use it too much) is the horizontal alignment of an element within a cell, which I will transcribe as follows:

<td align="center">content</td>

If I insert, within this same cell, a table (with or without fixed width) and I just use the attribute align= " center " on my cell (and even if I double it on my nested board)The table will remain on the left on SFR.fr.

<td align="center">
<table style="width: 200px;" border="0" width="200" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">contenu</td>
</tr>
</table>
</td>

The solution is (and this is now a good practice that I try to implement systematically) à add a style= "margin:0px auto;" to the nested table. Thus, I ensure a good horizontal alignment in the center for this painting. However, I can't just put this style in place and abandon the align attribute at the same time. The "align" attribute is still essential for good horizontal alignment on Outlook for example.

Need help?

Reading content isn't everything. The best way is to talk to us.


This gives us, therefore, to close the debate, the following code:

<td align="center">
<table style="width: 200px; margin:0px auto;" border="0" width="200" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">contenu</td>
</tr>
</table>
</td>

I'm not a fan of using multiple attributes or overloading the HTML code. But let's face it, it's always better to have the closest possible rendering on all webmails and e-mail programs, isn't it? Call to witness "It's my choice": Have you ever encountered this type of problem? Have you found other solutions to this problem? Does your mother-in-law manage your relationship? We'd love to hear from you!

Share
The author

6 réponses

  1. I have exactly the same concern and came to the same conclusion!

Laisser un commentaire

Your email address will not be published. Les champs obligatoires sont indiqués avec *