3 Column Layout - Looping through Dynamic Data

Bow

New Member
I have list of categories that is contained in \[code\]li\[/code\]'s on one column of my page (side bar). I now want it to span the whole width of the page in several columns. I would always like 3 or 4 columns to fit the page. This is the code that generates the one column.\[code\] <div id="sidebar"> <ul> {insert name=get_audio_categories assign=listcats} {section name=o loop=$listcats} <li><a href="http://stackoverflow.com/questions/3646269/{$baseurl}/z/{$listcats[o].CATID}/1/{$listcats[o].name}">{$listcats[o].name|stripslashes}</a> ({insert name=audio_categories_count value=http://stackoverflow.com/questions/3646269/a assign=atotal catid=$listcats[o].CATID}{$atotal} {$lang875}) </li> {/section} </ul> </div>\[/code\]I have asked a similar question before but this was using pure php and table layouts. I can't seem to extract this logic below and apply to the above smarty tpl file:\[code\]$nbCols = 4;$nbRows = count($indexes)/$nbCols;for($row=0; $row<$nbRows; $row++) { echo "<tr>"; for($i=0; $i<$nbCols; $i++) { $index = $indexes[$row + ($i*$nbRows)]; echo "<td>$index</td><td><input id='$index' name='$index' type='checkbox' /></td>"; } echo "</tr>";\[/code\]I can get the total number of categories.Thanks all for any help.
 
Back
Top