vertlime — 2013-02-15T09:23:02-05:00 — #1
I know I should use tables. When using CSS, should I place my code within the head tags or inline with my HTML within the body tags?
therealsjk — 2013-02-15T10:28:19-05:00 — #2
This is a very old post but just in case you still are looking for the answer, you should not use tables unless you have numerical tabular data for any html project. Instead you should use CSS for all of your formatting needs.
vertlime — 2013-02-15T16:24:17-05:00 — #3
For an html email, I think it's best to use tables for formatting the layout.
certificates — 2013-02-15T16:33:16-05:00 — #4
I agree, even if there are only two or three TDs or TRs in the table.
At least then you have some control of how the e mail will look when received
Still I'm no expert.
ralphm — 2013-02-15T23:20:24-05:00 — #5
Yes, to be sure your email will work across a reasonable range of email clients, you do need tables, unfortunately. It's amazing that this area is lagging so far behind web standards, but with companies like Microsoft basing Outlook around the Word rendering engine, there isn't much hope for things improving for a long time yet.
The safest way to add CSS to an HTML email is to place the styles inline—again, a real pain. Some email clients still strip out any styles contained in the <head> section, so it's not as reliable.
The ideal would be to code emails with web standards only. If we all did that, companies that provide crap email clients would go out of business, because people would stop using them. In reality, though, this never happens. (And it would basically mean everyne would have to use Mac Mail! :lol: )
therealsjk — 2013-02-17T01:59:22-05:00 — #6
Yes, I see the points for using tables. I have a Mac and always push for current standards. You might be interested in this article on this exact subject: http://www.sitepoint.com/code-html-email-newsletters/