playaz Posted March 22, 2006 Share Posted March 22, 2006 Hi guys,I am trying to get my array to display two items on each table row so its effectively two <td> tags. The effect I want is similar to how the "Technology partner" section looks on the the following site. [a href=\"http://tinyurl.com/lemxb\" target=\"_blank\"]http://tinyurl.com/lemxb[/a]If the array has more than two items it would need to make a new row <tr> - so each table row has 2 items and no more.Can anyone help me out :) Quote Link to comment Share on other sites More sharing options...
wisewood Posted March 22, 2006 Share Posted March 22, 2006 No time to explain... but this is what i use to create the same effect."" if (($x%2 "" is the bit that does the business... if you wanted to increase your table columns to 3, 4, 5 or whatever... just replace the 2 with the number of columns you need.Hope this helps you find a way to what you want to do.[code]<?php$bareQuery = "SELECT * FROM My_Table";$queryall = $bareQuery.$sorted;$resultall = MYSQL_QUERY($queryall);$numberall = mysql_Numrows($resultall);if ($numberall==0) { echo "No Slackers Found !";}else if ($numberall>0) {$x=0;?><table class="content" align="center"><?while ($x<$numberall) { if (($x%2)==0) { $row="</tr><tr><td>"; } else { $row="<td>"; } echo $row ?>[/code] 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.