I must be tired..

siforek

New member
Ok, so I'm pulling server plans and their details from the database. I could easily use a foreach and construct a table similar to: http://softlayer.com/servers_dedicated_all.html

It would look something like:
PHP:
<table>
<tr>
<td>name</td>
<td>price</td>
</tr>
{foreach key=num item=server from=$dedicated}
<tr>
<td>{$server.name}</td>
<td>{$server.price}</td>
</tr>
{/foreach}
</table>
But what if I want a table similar to: http://www.10tb.com/dedicated-hosting/ ?? I could use a foreach for every single row of the table like this:
PHP:
<table>
<tr>
<td>name</td>
{foreach key=num item=server from=$dedicated}
<td>{$server.name}</td>
{/foreach}
</tr>
<tr>
<td>price</td>
{foreach key=num item=server from=$dedicated}
<td>{$server.price}</td>
{/foreach}
</tr>
That would work, but I'm looking for an alternate solution that if possible, uses less code. Yes, I'm using smarty. This is within WHMCS and it is a custom page. Any suggestions would be great.
 
Back
Top