sean14592 Posted June 12, 2008 Share Posted June 12, 2008 Hello, I have a small problem withe thayout of images. I basically have some images/text and I want to put them into a table, Though my problem is I only want to have 5 images/text per coloumn. Here is my code: <?php if ($row['onpool'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Pool</span></td> </tr> </table>'); } if ($row['oncar'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Car Park Area</span></td> </tr> </table>'); } if ($row['onenter'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Entertainment</span></td> </tr> </table>'); } if ($row['onrest'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Resturant/ Cafe</span></td> </tr> </table>'); } if ($row['onlaun'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Laundret</span></td> </tr> </table>'); } if ($row['onsuper'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Supermarket</span></td> </tr> </table>'); } if ($row['ongym'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Gym</span></td> </tr> </table>'); } if ($row['onbar'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Bar</span></td> </tr> </table>'); } if ($row['ongolf'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Golf</span></td> </tr> </table>'); } if ($row['ontennis'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Tennis Courts</span></td> </tr> </table>'); } if ($row['onchildplay'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="100" valign="middle"><span class="style3">Childrens Play Area</span></td> </tr> </table>'); } if ($row['onchildclub'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="100" valign="middle"><span class="style3">Childrens Club</span></td> </tr> </table>'); } ?> Please help me, Thanks soooo much Sean Quote Link to comment https://forums.phpfreaks.com/topic/109916-please-help-thanks/ Share on other sites More sharing options...
ober Posted June 12, 2008 Share Posted June 12, 2008 1) Don't create a table for each entry. 2) 90% of that code is the same thing... you can reduce it GREATLY. Your if portion should only be around the second <td> element. 3) You're not showing us the loop that pulls from the database. 4) Are you creating a row that you're not showing us here? Quote Link to comment https://forums.phpfreaks.com/topic/109916-please-help-thanks/#findComment-564035 Share on other sites More sharing options...
sean14592 Posted June 12, 2008 Author Share Posted June 12, 2008 Im using a simple mysql query. lol, im confused. sean Quote Link to comment https://forums.phpfreaks.com/topic/109916-please-help-thanks/#findComment-564036 Share on other sites More sharing options...
sean14592 Posted June 12, 2008 Author Share Posted June 12, 2008 This might help, here is my full page code.... http://pastebin.com/m2c98b7c7 Thanks every1 again for helping sean Quote Link to comment https://forums.phpfreaks.com/topic/109916-please-help-thanks/#findComment-564069 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.