| The Arcive of vBulletin Modifications Site. | |
| 
			 
			#1  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  displaying records in a table of 3 cels in a row. 
			
			Here's my problem. I have a table and I dont want it to be any bigger than 3 cells a row. I have 5 records in a table in the database. How can I display 3 records per row? Thank you for the help.
		 | 
| 
			 
			#2  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			You just need to limit the MySQL query like so: PHP Code: 
			 | 
| 
			 
			#3  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			No no, I didn't explain myself correctly. http://www.tdswebnet.com/webhosting2.php I want all records to show, but 3 in a row. Not just 3 records. I tried what you posted, and that only showed 3 of the 5 records. Unless I did something wrong. Code: 		    <table align="center">
                <tr>
						  <?php do { ?>
                  <td><table width="300" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="2" class="name_gradient"><?php echo $row_callhosting['feature']; ?></td>
                      </tr>
                      <tr>
                        <td class="lite_blue">Starting At<br />
                          <span class="style2"><strong><?php echo $row_callhosting['price']; ?></strong></span><br />
                          <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('BuyNow','','images/buynow_over.jpg',1)"><br />
                          <img src="images/buynow_out.jpg" alt="Buy Now!" name="BuyNow" width="110" height="47" border="0" id="BuyNow" align="center"/></a><br />                                                </td>
                        <td class="feature_table"><span class="features">FEATURE</span><br />
                          Space: <?php echo $row_callhosting['space']; ?><br />
                          Bandwidth: <?php echo $row_callhosting['bandwidth']; ?><br />
                          Database(s): <?php echo $row_callhosting['db']; ?><br />
                          Email Accounts: <?php echo $row_callhosting['email']; ?><br />
                          FTP Accounts: <?php echo $row_callhosting['ftp']; ?><br />
                          Domains: <?php echo $row_callhosting['domains']; ?><br />
                                  <?php echo $row_callhosting['scripts']; ?><br />
                          Cpanel: <?php echo $row_callhosting['cpanel']; ?></td>
                      </tr>
                                </table>
								</td>
<?php } while ($row_callhosting = mysql_fetch_assoc($callhosting)); ?>
                </tr>
                        </table> | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Ah - See if this works: PHP Code: 
			 | 
| 
			 
			#5  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Yes it did. I really appreciate your help. I'm going to have to study what it says so I can understand how it was done. Thank you so very  much.
		 | 
| 
			 
			#6  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Your very welcome - I tried to comment my changes so you would understand it. Basically, I used a variable to see how many cells had been displayed so far. Then after each cell I do a check to see if three have been displayed yet. If so, then it starts a new row and the process starts over. At the end then, I used a for() loop to fill in any remaining cells, so that way the table would display properly. Feel free to PM me if you have any more PHP/MySQL questions and I'll be more than happy to help you out.
		 | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |