user123 user123 - 2 months ago 6
CSS Question

HTML Email : Images go beyond table width

I am making HTML Emailer.

The issue that I am facing is, when I put 5th images in a single row then it expands table width, rather than going down in the center of new line.



<table cellspacing="8" style="margin: 0 auto; text-align: center; max-width: 500px !important; " width="500">
<tr>
<td align="center" style="text-align:center;height:60px; padding:10px;'.$border.'">
<img src="http://www.hubilo.in/images_for_links/facebook.png" width="110">
</td>
<td align="center" style="text-align:center;height:60px; padding:10px;'.$border.'">
<img src="http://www.hubilo.in/images_for_links/facebook.png" width="110">
</td>
<td align="center" style="text-align:center;height:60px; padding:10px;'.$border.'">
<img src="http://www.hubilo.in/images_for_links/facebook.png" width="110">
</td>
<td align="center" style="text-align:center;height:60px; padding:10px;'.$border.'">
<img src="http://www.hubilo.in/images_for_links/facebook.png" width="110">
</td>
</tr>
</table>





What I want is , when i put 5th image then it should be down to the center of the new line. also it would be great , that the same output can be displayed in Outlook

Any help would be grateful.

Thank You.

Answer

Try using display:inline-block in your td.

Comments