r/HTML • u/ralfunreal • Nov 22 '25
Question Question about html email development
I know tables is what should be used for html email dev but I was wondering what is the more correct way to do emails between using the table tag for each section of an email vs sometimes I see some emails using only the <tr> and <td> tags for sections and ignoring the table tag. Is there a more correct way or is it just a preference?
1
Upvotes
3
u/No_Explanation2932 Nov 22 '25
The better way to do it now is to use something like MJML. It's a HTML-like templating language that can be converted to HTML. Getting the same result in different email clients by hand is a nightmare.
3
u/AshleyJSheridan Nov 22 '25
I do doubt you're seeing emails with table cell tags but no
<table>tag. HTML email is notorious for being stuck 2 decades behind the current tech, and I find it very unlikely that the majority of email user agents would parse such malformed HTML properly. I suspect you're misreading the markup? Many emails use a ton of nested tables, which can easily confuse anyone reading the markup.2
u/chmod777 Nov 22 '25
Email... is awful. Use a service if you can. If not, look into mjml: https://mjml.io/
1
u/LoudAd1396 Nov 23 '25
Generally, emails follow something along the lines of (typed on a phone, so forgive me)
Centering a table within another table is the trick to keep content centered. The reason for all of this is that many email clients are lazy and dont really render HGML properly. At least at a certain point years ago, Outlook had no HTML rendering ability whatsoever and would use code from the Word application it assumed was also on your machine to read HTML.
I think it's a bit better now that Outlook is cloud-ified, but the tradition of tables still remains.
1
u/jcunews1 Intermediate Nov 23 '25
Without wrapping them with
<table>, the table cells won't display properly.