Dynamic <td> generation when retrieving data from database...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anyone have a script which will do the following:

For a shopping cart, I have the merchandise coming from the database
(image references, prices, ids, names, etc.)

When I begin to display the results on the page I want to be able to
specify my <td> colspans and basic HTML table structure dynamically.

For example, if result is 4, I want this

<tr>
	<td>image1</td>
	<td>image2</td>
	<td>image3</td>
</tr>
<tr>
	<td colspan=3>image4</td>
</tr>

if it's 5,
<tr>
	<td>image1</td>
	<td>image2</td>
	<td>image3</td>
</tr>
<tr>
	<td>image4</td>
	<td colspan=2>image5</td>
</tr>

etc.

Any idea, scripts?





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux