vinpkl Posted March 21, 2009 Share Posted March 21, 2009 hi all i have html emailer which displays perfect in yahoo, hotmail, rediff. but i dont know what is happening in gmail. after 4th product, the rows and columns get distort. i have attached screen shots of yahoo and gmail to make my problem more clear. vineet $body=" <html> <head> <link rel='stylesheet' type='text/css' href='http://domain/includes/stylese.css' /> </head> <body> <table width='700' border='0' align='center' cellspacing='0' cellpadding='0' style='border:4px solid #A1B22D'> <tr> <td bgcolor='#FFFEBE'>"; $columns_counter=0; $body .= "<table>"; $body .= "<tr>"; while($row_p = mysql_fetch_array($result_p)) { $body .= "<td width=140 align=center height=137>" ."<img style='border:2px solid #a2a2a2' alt='mobile phones' src='http://domain/graphics/thumbs/" . $row_p['prod_thumb'] . "'/></td> <td width='235'>".$row_p['product_name'] ."</td>"; $columns_counter++; if($columns_counter==2){ $body .= "</tr>"; $columns_counter=0; } } $body .= "</table> </td> </tr> </table> </body> </html>"; [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/150438-row-and-columns-problem-in-gmail/ Share on other sites More sharing options...
AP81 Posted March 21, 2009 Share Posted March 21, 2009 I think the way you're generating the table rows is incorrect. Try this: <?php $columns_counter=0; $body .= "<table>"; while($row_p = mysql_fetch_array($result_p)) { if ($columns_counter == 0) { $body .= "<tr>"; } $body .= "<td width=140 align=center height=137>" ."<img style='border:2px solid #a2a2a2' alt='mobile phones' src='http://domain/graphics/thumbs/" . $row_p['prod_thumb'] . "'/></td> <td width='235'>".$row_p['product_name'] ."</td>"; $columns_counter++; if($columns_counter==2){ $body .= "</tr>"; $columns_counter=0; } } ?> Link to comment https://forums.phpfreaks.com/topic/150438-row-and-columns-problem-in-gmail/#findComment-790155 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 that html is perfect mate can i see the code that email this code please. can i have a link to that code as well please. are you adding the message=$body and sending it as it is. height not legal in html use css. <td STYLE='width: 140; align: center; height: 137;'> Link to comment https://forums.phpfreaks.com/topic/150438-row-and-columns-problem-in-gmail/#findComment-790160 Share on other sites More sharing options...
vinpkl Posted March 21, 2009 Author Share Posted March 21, 2009 hi AP81 Thanks a lot. This works perfect. vineet I think the way you're generating the table rows is incorrect. Try this: <?php $columns_counter=0; $body .= "<table>"; while($row_p = mysql_fetch_array($result_p)) { if ($columns_counter == 0) { $body .= "<tr>"; } $body .= "<td width=140 align=center height=137>" ."<img style='border:2px solid #a2a2a2' alt='mobile phones' src='http://domain/graphics/thumbs/" . $row_p['prod_thumb'] . "'/></td> <td width='235'>".$row_p['product_name'] ."</td>"; $columns_counter++; if($columns_counter==2){ $body .= "</tr>"; $columns_counter=0; } } ?> Link to comment https://forums.phpfreaks.com/topic/150438-row-and-columns-problem-in-gmail/#findComment-790162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.