PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I found another pretty code
[syntax="smarty"]{assign var=max_in_row value=3}
{assign var=col_count value=1}
<table>
{foreach from=$products item=product}
{if $col_count == 1}<tr>{/if}
<td>{$product.prod_name|escape}</td>
{assign var=col_count value=$col_count+1}
{if $col_count > $max_in_row}</tr>{assign var=col_count value=1}{/if}
{/foreach}
{if $col_count > 1}
{math equation="x + 1 - y" x=$max_in_row y=$col_count assign=cols}
{section name=myloop loop=$cols}
<td> </td>
{/section}
</tr>
{/if}
</table>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]