Horizontal menu loop until end of screen
I need to create a loop to display the horizontal menu items until it reaches the end of the screen and then start on the next line. I have written the following code which displays one menu item on the first line and then the rest on the second.
<table cellpadding="0" cellspacing="0" >
<tr >
{foreach from=$categories item="category" name="h_categories"}
{if $smarty.foreach.h_categories.first}
<td class="hcNonActiveItembr{$category.categoryid}" height="25" nowrap="nowrap" valign="bottom">
<a href="home.php?cat={$category.categoryid}" class="hcLink"
onmouseover="rollover('{$category.category}1','{$c ategory.category}1.gif')"
onmouseout="rollover('{$category.category}','{$cat egory.category}.gif')">
<img src="{$ImagesDir}/custom/{$category.category}.gif" name="{$category.category}.gif" alt="{$category.category}"></a>
</td>
</tr>
<tr>
{else}
<td class="hcNonActiveItembr{$category.categoryid}" height="25" nowrap="nowrap" valign="bottom">
<a href="home.php?cat={$category.categoryid}" class="hcLink"
onmouseover="rollover('{$category.category}1','{$c ategory.category}1.gif')"
onmouseout="rollover('{$category.category}','{$cat egory.category}.gif')">
<img src="{$ImagesDir}/custom/{$category.category}.gif" name="{$category.category}.gif" alt="{$category.category}"></a>
{/if}
{/foreach}
Please help.
__________________
Chris Berendt
X-Cart Version 4.1.9
|