HTML Responsive Tables

Soldato
Joined
21 Jul 2004
Posts
6,332
Location
Bromley / Uxbridge
I am trying to create a responsive email using HTML and CSS and seem to have hit a snag.

I have a container table, with two tables within in, which float. However, I want to vertically align them to the bottom of that container, irrespective of their heigh.

I set up a JSFiddle here:
http://jsfiddle.net/hirenshah/mhn3oavx/

The pink area needs to be at the bottom and not the top, but I have read that it is not possible to do whilst the tables are floating.

Any suggestions?
 
Soldato
Joined
9 Mar 2010
Posts
2,838
Hum, I was going to help but you'll need to explain more clearly what you're wanting to achieve.

If you want the "hello1" table to appear at the bottom simply put it after the "hello2" table surely?

And what container do you want to align them to the bottom of? The container on the JS fiddle webiste? or the container that you have a class for but haven't set a hight for?

http://jsfiddle.net/9tf4xg6d/ - is not what you're trying to achieve?

20AoIef.png
 
Soldato
Joined
9 Mar 2010
Posts
2,838
Gotcha.

Usiung media queries when the width is 601px or above then add to .hello1

position: absolute;
bottom: 0px;

.container will need to be "position: relative" for the hello1 div to stay inside it.

http://jsfiddle.net/bdL1hbog/

The chances of this working in many email clients is not very high though :)
 
Soldato
Joined
27 Oct 2002
Posts
3,540
Location
At the fulcrum of humdrum
You mean something like this?

https://litmus.com/pub/fe64b90

Notes:

1. Outlook 2007/10/13 look wrong because I've used a styled div as a substitute for an image, and Outlook collapses divs. If that were an actual image, the layout would work.

2. Achieving this took all sorts of faffing with conditional MSO comments, duplicate markup, and other tricks I've learned in 10+ years of building HTML emails...

3. ... so seriously consider rethinking your design...

4. ... and don't use floats or position:bottom as they're not properly supported in Outlook, Gmail, Yahoo etc.

I'll post the markup here if you want it. I can't JFiddle, because it doesn't like inline CSS.

So it is possible. Kinda. But you'd be much better off redesigning your layout. Hope that helps :)
 
Soldato
OP
Joined
21 Jul 2004
Posts
6,332
Location
Bromley / Uxbridge
Cheers for the advice guys :)

I've gone back to the design team and just told them it isn't possible to do (may not be completely accurate but it stops the discussion right there). In the mean time I've continued with the proof of concept and this is what I have so far:
http://jsfiddle.net/hirenshah/rdux8vkg/15/

MSO is oh so annoying when it comes to ignoring specified image dimensions, so I'm going to have to use if logic everywhere to use a different image for MSO :(
 
Associate
Joined
19 Jan 2011
Posts
361
Responsive emails are nothing short of alchemy. I attended a talk by the head guy from Mail Chimp, and basically it's hack city if you care about it working for any but the most recent email clients.

I'd recommend looking at the mail chimp templates as they're pretty interesting. I'd also suggest, where possible, simplifying the layout down as much as possible to start with – I think they days of HTML emails which are little more than chopped up versions of print flyers are (rightfully) numbered.
 
Soldato
Joined
27 Oct 2002
Posts
3,540
Location
At the fulcrum of humdrum
All the frameworks in the world won't help you if the email has been designed by someone who doesn't understand the very specific requirements [read: "limitations"] of responsive email design, unfortunately.

If you're lucky enough to be in the position of doing both design and build, then a framework is a massive timesaver - not just in terms of building the structure, but also by reducing the amount of testing time.

However, if I had a pound for every time I'd had to deal with an email that had been designed as a web page [Text over background images! Ornate borders! Inflexible text areas! Forms!!] or even worse: print flyers [as macmodder mentioned - lots of tiny text! No CTAs! Non-trackable phone numbers!], then... well, I wouldn't have had to start my own email business :D
 
Last edited:
Back
Top Bottom