title: Responsive html email on android nexus 5 (4.4.2) native mail app
body: <p>I've a test layout which uses tables for displaying two columns and media queries which stacks the two columns to one on email clients which support media queries. I am sticking with tables instead of divs as we need to support Outlook as well :(. The layout works great in Android 4.3 and below (the columns stack up) but blows up on Nexus 5 (Android 4.4.2). The two columns still show up next to each other with the second column being completely squished. It seems like 4.4.2 does not support display block at td. Has anyone else experienced this? If yes, is there any work around for this? By the way, it seems like only display block and display:inline-block are not supported on Nexus 5, if I set the tds to display:none in my media query, they are hidden on the screen. Below is a basic html email template which doesn't work:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;meta name="viewport" content="initial-scale=1.0;width:device-width"&gt;
      &lt;!-- So that mobile webkit will display zoomed in --&gt;
      &lt;title&gt;Email template&lt;/title&gt;
      &lt;!-- disable auto telephone linking in iOS --&gt;
      &lt;meta name="format-detection" content="telephone=no"&gt;
      &lt;style type="text/css"&gt;
          @media screen and (max-width:640px) {
              table[class="container"] {
                  width: 100%!important;
              }
  
              td[class="cell"] {
                  background-color: #cc3333;
                  width: 100%!important;
                  display: block!important;
              }
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;table width="640" align="center" cellpadding="0" cellspacing="0" class="container"&gt;
          &lt;tr&gt;
              &lt;td class="cell"&gt;Hello world&lt;/td&gt;
              &lt;td class="cell"&gt;Hello world&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Edit 1/14</strong> So using tables as block elements works. Since the tables are floated (using align) they wrap in case the width is less than 640px. Now the only issue is, when the two tables wrap, since their width is set to 320px the text doesn't reflow to 100% on devices with native resolution of more than 320px but less than 640px (say iPhone in landscape mode which is 480px) but instead wraps at 320px (leaving around 160px of white space on the right). I know I can change the width using media query but unfortunately it doesn't work on Gmail app (grrh). Any thoughts/suggestions? Simple table structure -</p>
  
  <pre><code>&lt;table align="center" style="width: 640px;max-width:100%"  cellpadding="0" cellspacing="0"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;table align="left" style="width:49%;" border="1"&gt;
                  &lt;tr&gt;
                      &lt;td style="max-width: 100%"&gt;long text which should take about 480px
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
              &lt;table style="width:49%;max-width: 100%" align="left"&gt;
                  &lt;tr&gt;
                      &lt;td style="width:100%;"&gt;long text which should take about 480px
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>