0

I am trying to find out a solution of adding tables next to each other without using 'float:left;'. I am using the code for an email template and 'float' doesn't work on Outlook and some other email clients.

I have tried everything I could think of, searched the forum and all over the web but I am unable to find a solution.

Here's the code I am using:

<table width="155" height="155" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff" class="main-content" style="float:left;margin-bottom:20px;">
  <tbody>
      <tr>         
         <td><img style="border:0;" align="none" height="113" width="166" src="<?php echo $post_thumbnail ?>"  /></td>
         <td bgcolor="#f4f4f4" width="35" style="color:#f4f4f4;">T</td>
      </tr>
      <tr>        
     <td style="font-family:arial;font-size:13px;font-weight:bold !important;line-height:17px;padding:10px 10px 0;"><strong>Text</strong></td>
     <td bgcolor="#f4f4f4" width="35" style="color:#f4f4f4;">T</td>
      </tr>

      <tr>        
    <td width="155" style="color: #666;font-size:13px;padding:0 10px 15px;">  
        <a style="background-color:#ac0003; color:#ffffff; border:1px solid #660b0e;cursor: pointer; display: block; font-family:Arial, Helvetica, sans-serif; font-size:12px; margin: 0 auto;margin-top:10px;padding: 2px 11px;;text-decoration:none;color:#ffffff; font-weight:bold;text-align:center;text-decoration:none;" href="<?php echo $post->guid ?>">Text</a>
     </td>
     <td bgcolor="#f4f4f4" width="35" style="color:#f4f4f4;">T</td>
      </tr>


      </tbody>

</table>

Help!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
kat_indo
  • 412
  • 2
  • 10
  • 24
  • Hey, First result in a search, is that helpful? http://stackoverflow.com/questions/15367542/in-outlook-html-email-float-does-not-work – Ronni Skansing Feb 17 '14 at 02:29
  • Thanks @RonniSkansing! I have already gone through the guides from MailChimp, Campaign Monitor, etc, but they don't have something specific written to give me a solution. – kat_indo Feb 17 '14 at 02:33
  • http://www.email-standards.org/ it does not give another solutions either, but a good place to check what specific vendors are able to. – Ronni Skansing Feb 17 '14 at 02:36

3 Answers3

1

You can try giving the table elements a display of inline. They should then line up next to each other.

Gray Spectrum
  • 723
  • 2
  • 7
  • 21
0

User display: inline-block; instead of float:left;

Jagadeesh
  • 1
  • 1
  • 1
  • 2
0

For html email you should be using align="left" instead.

Here is an example

Community
  • 1
  • 1
John
  • 11,985
  • 3
  • 45
  • 60