question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mj-column width doesn't work on Gmail mobile and desktop when printing

See original GitHub issue

Describe the bug the width property of the mj-column element is ignored on mobile and on desktop when using the Print functionality of Gmail.

To Reproduce Steps to reproduce the behavior:

  1. Create a file with this MJML code:
<mjml>
  <mj-body>
    <mj-section>
      <mj-column width="50%" background-color="red">
        <mj-text>Left column</mj-text>
      </mj-column>
      <mj-column width="50%" background-color="orange">
        <mj-text>Right column</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

  1. Render it to HTML
  2. Send the HTML to a Gmail address
  3. Open the mail with Gmail
  4. On desktop, use the “Print” functionality on the dropdown of the mail
  5. See the error

Gmail Print button

Expected behavior Columns should be displayed side-by-side :

Expected side by side columns

Observed behavior Columns are displayed over under, with a width of 100%.

Oberserved over under columns

MJML environment (please complete the following information):

  • OS: Linux
  • MJML Version 4.0.5

Email sending environment(for rendering issues):

  • SendGrid

Affected email clients (for rendering issues):

  • Email Client: Gmail (others untested yet)
  • OS: All
  • Browser: All

Additional context I tried the solutions given for the following issues but they didn’t do the trick (unless I missed something) :

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iRyusacommented, Dec 3, 2018

And you have also Mj-group to keep the same behavior on mobile

On Mon, Dec 3, 2018 at 7:55 PM Maxime Brazeilles < maxime.brazeilles@gmail.com> wrote:

Yep, cf here https://mjml.io/documentation/#mjml-column

On Mon, Dec 3, 2018 at 7:50 PM neeh notifications@github.com wrote:

Thanks @iRyusa https://github.com/iRyusa for your quick answer!

What about mobiles? Is the stacking of columns intended? Is there a way to force columns to be side by side on mobile?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mjmlio/mjml/issues/1444#issuecomment-443824307, or mute the thread https://github.com/notifications/unsubscribe-auth/AAizzcmfl-fkLM8s0FLlc2Zd6UpQd_oFks5u1XKCgaJpZM4Y_J_c .

– Cordialement, Maxime BRAZEILLES

– Cordialement, Maxime BRAZEILLES

0reactions
neehcommented, Dec 4, 2018

Thanks! I should’ve had a better read at the doc for mobiles. I’m closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MJML column width incorrect on Android GMAIL App
I have created a responsive flyer template using the latest mjml transpiler (2.0.0). The mjml source can be viewed at ...
Read more >
mjml-guides – Documentation for MJML - The Responsive ...
The sum of columns in a section cannot be greater than the width of the parent `mj-section` (or 100%). Every single column has...
Read more >
MJML – How To Make Responsive HTML Email Coding Easy
Once again, this section is easy to achieve by leveraging the <mj-column> component, using one column per social network icon and wrapping all ......
Read more >
What is your email framework of choice? - Litmus
MJML, on the other hand, defaults all mobile columns to 100% width. This means that to create multi-column mobile layouts you employ another ......
Read more >
CSS Media Queries & Using Available Space
@media screen { body { width: 75%; } } @media print { body { width: ... emails to make them look awesome in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found