justAnoob Posted May 29, 2009 Share Posted May 29, 2009 I'm trying to echo a horizontal hr line inbetween each row that is echoed. Right now one line gets echoed underneath the last row. Where should I place the commented line below so that a line seperates each echoed row. <?php echo "<table border='0' CELLPADDING=5 STYLE='font-size:16px'>"; while ($row = mysql_fetch_array($sql)) { echo "<tr><td align='center'>"; echo '<a href="viewitem.php?sendto='.$row['id'].'"><img src="' . $row['imgpath'] . '" width="125" border="0" alt=""></a>'; echo "</td><td align='center'>"; echo "".substr($row['item_name'],0,50),""; echo "</td><td align='center'>"; echo substr($row['description'],0,50).'<a href="viewitem.php?sendto='.$row['id'].'" class="view_item"> ...more</a>'; echo "</td><td align='center'>"; echo substr($row['in_return'],0,50).'<a href="viewitem.php?sendto='.$row['id'].'" class="view_item"> ...</a>'; echo "</td><td align='center'>"; echo "</td></tr>"; } echo "</table>"; echo '<hr width="550">'; /////////this line here ?> Quote Link to comment Share on other sites More sharing options...
fullyscintilla Posted May 29, 2009 Share Posted May 29, 2009 You need to add a loop increment so you can count the increment and setup an if statement to catch the last one and NOT put a "hr" Quote Link to comment Share on other sites More sharing options...
justAnoob Posted May 29, 2009 Author Share Posted May 29, 2009 I'm not too worried about having a line under the last one right now,, I just want to have a line in between each echoed row. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 29, 2009 Share Posted May 29, 2009 It's in a table. Why do you need a HR tag in between each row? Quote Link to comment Share on other sites More sharing options...
justAnoob Posted May 29, 2009 Author Share Posted May 29, 2009 Sorry for the late post,, but I think I figured it out. Quote Link to comment 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.