2

I need to update an old email template. In the old template, which are like 4-5 years old, I found stuff like

<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" class="bodyTable">

Now I am not sure why they used the those syntax, just because it is old, or is there any other mail-template related reason? Can I change them without any concern into, let's say:

<table style="text-align:center;border:0;height:100%; width:100%" class="bodyTable">

If not, can someone maybe explain to me why?

4
  • if you want you can change, no issues Commented Jul 9, 2019 at 14:47
  • “If not, can someone maybe explain to me why?” - that alone would justify closing this question as too broad IMHO. HTML e-mail is a complex topic, at lot has been written about that already - so please do some proper reading up on the topic, if you run into any issues. Commented Jul 9, 2019 at 14:48
  • 3
    Emails clients are not good at rendering HTML, using the old HTML attributes may be a more reliable solution if the recipients might be using older versions of email clients Commented Jul 9, 2019 at 14:52
  • Read the long answers below, in short: Outlook is the most troublesome email client and doesnt ready styles on elements the right way. I advice to keep it but ditch height="100%". it has weird outcomes in Apple mail (atleast in Litmus) Commented Jul 10, 2019 at 7:04

1 Answer 1

6

It is, or at the least was, the recommended style for HTML emails. For instance, "HTML attributes instead of CSS" are advised by Smash Magazine. While CSS support is gradually improving, there is no universal HTML email standard, so each email client supports its own subset of HTML/CSS. Thus, email designers are often advised to "think XX century" or even post-process their email templates with special inlining/downgrading tools, such as http://premailer.dialect.ca (and a few others).

I'd say CSS has been well supported by major email clients for several year, yet, say in 2011 I find occasional stackoverflow complains of gmail stripping styles attributes HTML email in Gmail - CSS style attribute removed.

So I guess authors opted to play save. It is not uncommon for companies to care even of users stuck with somewhat outdated software.

According to this list, the major and current email clients support the style attribute well. Still, there is always a risk that a particular tag, attribute, or their combination are not supported by a less know email client, sometimes due to a bug or a corner case, as you can see in a relatively recent post regarding Spark client HTML Email formatting stripped out.

Sign up to request clarification or add additional context in comments.

3 Comments

Another great resource is campaign monitors css support list found here: campaignmonitor.com/css/tables/table-layout.
@Syfer, unfortunately the referred campaignmonitor.com/css page was not updated since 2017, according to their history notes
@MichaelFreidgeim more than happy to remove it if there is any better resource. Campaign monitor has been stagnant for a while it seems same as email issues being?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.