Please verify error in Campain Monitor's sample code

I am viewing this article:
http://www.campaignmonitor.com/guides/mobile/responsive/

After closely examining everything to make sure I copied it exactly (I did), I spent about 30 minutes trying to figure out why it wasn't responsive like it should be.

What I discovered was that this code...

<table width="640" border="0" cellpadding="0" cellspacing="0" class="contenttable">

...should really be this:

<table border="0" cellpadding="0" cellspacing="0" class="contenttable">

The only difference is I removed the width="640" and now it acts responsive. Otherwise, it does not scale down as it supposedly should. I believe the order of specificity prohibits the CSS from overriding the hardcoded 640 width.

I also noticed the example Github code given at the end has a width of 100% not 640, so I think it's an oversight in the article that should be corrected.

jmwhite, 2 years ago

Actually both the width of 640 and the contenttable class should both be present on the containing table. You'd need to leave in the width of 640 for desktop clients, and then override the width set with the contenttable class for mobile devices

nate22, 2 years ago

You can test it right here and see it doesn't work:

http://www.studiopress.com/responsive/

nate22, 2 years ago

If change the media query from 'max-device-width' to 'max-width' it solves the problem and I get responsive stacking of the columns everywhere.

My previous responsive designs all used 'max-device-width' so I'm not sure why it won't work for these tables, too, in the browser and on desktop email.

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098