0

So, saw a bunch of posts of how gmail handles html emails ... I saw that I needed to use inline styles, and also saw a post about using spaces after ";" and ":" in my inline styles ... but I'm still running into issues. My issue is that I am designating table cell widths (30-70), but my table is still not showing the correct widths (more like 90-10 in gmail). This is mainly a gmail issue -- The styles still show in other mail clients. I've done some homework, but can't find any solutions...

Styling HTML email for Gmail

Table cell width in HTML email does not correspond to width set in HTML or CSS

Below is how I am creating the message for the form (in PHP) ... note the width="30%" and the inline styles (width:30%). Still, this gets ignored in gmail. Below is a snippet of the code...

$to_email[] = "<TABLE style=\"font-size: 90%; \">";
        $to_email[] = "<TR>";
            $to_email[] = "<TD width=\"30%\" style=\"width: 30%; \">Column 1</TD>";
            $to_email[] = "<TD width=\"70%\" style=\"width: 70%; \">Column 2</TD>"; 
        $to_email[] = "</TR>"; // Then more code to finish the page

When I look at the page in google, the left width looks like it is around 90% and the right is about 10%. Note: There are no images in the email, that would force a larger width.

When I "inspect element" and view the code in google to see the email, the code looks like this...

<table><tbody><tr><td>Column 1</td><td>Column2></td></tr>
<!-- ... etc. -->

Anyone know what is wrong? As I said, the styles and everything else show up in other mail clients, so the form works fine. It's just gmail...

Note: When I save the .eml file from gmail and open it in notepad, all of the widths are there... Not sure what is going on.

Let me know. Thanks.

Jabbamonkey
  • 272
  • 4
  • 23
  • Those answers are obsolete; as noted in one of the answers to your first linked question, [GMail added support for ` – Adam Katz Oct 28 '19 at 19:09
  • I read that – Jabbamonkey Oct 28 '19 at 19:48
  • Yes, that's what the questions you linked assert, but it's no longer accurate at least according to the answer I linked. Feel free to run some tests to see for yourself. – Adam Katz Oct 28 '19 at 20:26
  • Yup, didn't work. – Jabbamonkey Oct 29 '19 at 13:32

1 Answers1

0

Couldn't find a good answer, so I completely restructured the form, using new headers and now the form works in google. So, check your headers...

Jabbamonkey
  • 272
  • 4
  • 23