tags:

views:

31

answers:

2

Here is a self explaining example of my problem - http://orkz.id.lv/test/test.html

Open with any IE version (not sure about IE9)

Can't figure this out ..

A: 

You have to remove any caracter as white space or line break between your image and your <td> tag, or set font-size:0; for it.

IE (even IE9) likes to render any caracter in inline content...

MatTheCat
this didn't help either
adomak
A: 

I replaced all those silly style attributes with real CSS rules (and also changed them a bit) and now it works in my IE (IE9 beta):

<!DOCTYPE html>

 <html> 
  <head> 
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> 
    <title> 
      Newsletter
    </title> 
  </head> 
  <body> 
    <style type="text/css" media="screen"> 
        body { padding:20px; }
        table { border: 3px solid green; border-spacing:0; margin-bottom:20px; }
        td { border: 1px solid red; padding:0; width:300px; }
        td img { display:block; }
    </style> 

    <table> 
        <tr> 
            <td colspan="2">text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping text is wrapping </td> 
        </tr> 
        <tr> 
            <td><img src="http://dummyimage.com/300x50/000/fff"&gt;&lt;/td&gt; 
            <td><-- big gap in IE(6-8). bad!!</td>                      
        </tr>           
    </table> 

    <table> 
        <tr> 
            <td colspan="2">not wrapping text</td> 
        </tr> 
        <tr> 
            <td><img src="http://dummyimage.com/300x50/000/fff"&gt;&lt;/td&gt; 
            <td>good</td>                       
        </tr>           
    </table> 

  </body> 
</html>
Šime Vidas
this didn't help.. (updated example)
adomak
@adomak Why were you using `style` attributes anyway? They are just bad practice...
Šime Vidas
It's for an email template. Anyways, thanks
adomak
@adomak Do email templates require using `style` attributes instead of placing the CSS inside the `<style>` element in the HEAD of the template?
Šime Vidas
I really dont know. This is first time I'm writing HTML for email. I thought inline style is best practice..
adomak
@adomak I just addressed that issue in this question http://stackoverflow.com/questions/4014600/do-html-email-templates-require-the-use-of-the-style-attribute
Šime Vidas