Solarpitch Posted June 9, 2007 Share Posted June 9, 2007 Hey Guys, Having a slight problem with the below code. As it loops through the db and outputs the data . . it displays it along the webpage as one continuous line. ie: <output box> <output box> <output box> <output box> I want it to display like <output box> <output box> <output box> <output box> So how could I put a break in this code to allow my data to format like that? Thanks, Ger while($row = $result->fetch_assoc()) { echo "<td class='table_style'><table width='700' height='32' border='0' cellpadding='0' cellspacing='0'> <tr> <td> </td> <td width = 100>image</td> <td width = 100>". $row['header'] ."</td> <td width = 100>" . $row['make'] . "</td> <td width = 100>" . $row['county'] . "</td> <td width = 100>" . $row['price'] . "</td> <td width = 100>View Ad</td> </tr> </table></td>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/54887-solved-quick-php-output-question/ Share on other sites More sharing options...
simcoweb Posted June 9, 2007 Share Posted June 9, 2007 You have your html table code set for one <tr>. Change it so each <td> is in its own <tr> and it will take care of the problem. <tr><td>Code for display here</td></tr> <tr><td>next code for display here</td></tr> etc. Quote Link to comment https://forums.phpfreaks.com/topic/54887-solved-quick-php-output-question/#findComment-271442 Share on other sites More sharing options...
Solarpitch Posted June 9, 2007 Author Share Posted June 9, 2007 Your right! Should have seen that. Thanks mate Quote Link to comment https://forums.phpfreaks.com/topic/54887-solved-quick-php-output-question/#findComment-271448 Share on other sites More sharing options...
simcoweb Posted June 9, 2007 Share Posted June 9, 2007 No problemo Quote Link to comment https://forums.phpfreaks.com/topic/54887-solved-quick-php-output-question/#findComment-271451 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.