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 ?> Link to comment https://forums.phpfreaks.com/topic/160091-solved-help-with-hr-line-please/ 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" Link to comment https://forums.phpfreaks.com/topic/160091-solved-help-with-hr-line-please/#findComment-844631 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. Link to comment https://forums.phpfreaks.com/topic/160091-solved-help-with-hr-line-please/#findComment-844642 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? Link to comment https://forums.phpfreaks.com/topic/160091-solved-help-with-hr-line-please/#findComment-844648 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. Link to comment https://forums.phpfreaks.com/topic/160091-solved-help-with-hr-line-please/#findComment-844650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.