Jump to content

Horizontal Looping within another while loop


dprichard

Recommended Posts

I know that I can do the following to loop something

 

$i=1;

while $i<5 {

}

$i++;

 

I have an array that I am looping through and I am trying to figure out how to loop horizontally and every 4 TD throw it down to the next row.  So, loop for 4 horizontally, then break it with a </tr><tr> to start a new row.  I am just having a little trouble figuring this out.

 

Any help would be greatly appreciated.

 

<table width="872">
	<tr>
                       <?php while ($row_ticketdetails = mysql_fetch_array($ticketdetails)) { ?>
		        <td height="120" align="left" valign="top" class='criticaldetails'><div class="criticaltext">
                                          Subject: <?php echo $row_ticketdetails['subject']; ?><br />
                                          Name: <?php echo $row_ticketdetails['fullname']; ?><br />
                                          Email: <?php echo $row_ticketdetails['email']; ?><br />
                                          Phone: <?php echo $row_ticketdetails['phoneno']; ?></div>
		        </td>
                       <?php } ?>
               </tr>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.