Sonu2007 Posted August 8, 2017 Share Posted August 8, 2017 I have following code which generates Configurable Options each per line in table. but i want to show 2 Configurable Options per line but not sure how to do it. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="data2" style="border-top:0px;border:1px solid #ddd"> <th colspan="2" align="center">Configurable Options</th> {if $configurableoptions} {foreach from=$configurableoptions item=configoption} <tr><td class="odd3" style="padding-left:10px" >{$configoption.optionname}:</td><td style="padding-left:10px">{if $configoption.optiontype eq 3}{if $configoption.selectedqty}{$LANG.yes}{else}{$LANG.no}{/if}{elseif $configoption.optiontype eq 4}{$configoption.selectedqty} x {$configoption.selectedoption}{else}{$configoption.selectedoption}{/if}</td></tr> {/foreach} </table> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 9, 2017 Share Posted August 9, 2017 the basic way to do it would be like this... {assign brian ['left','right','left','right']} <table border=1 width=25%> {foreach $brian as $item} {if $item@first}<tr>{/if} <td>{$item}</td> {if $item@last}</tr> {else} {if $item@iteration is div by 2}</tr><tr>{/if} {/if} {/foreach} </table> ignore the assign line of code (I just needed an array to output) and the adding of a border and width to the table (as that's for my output only) - concentrate on what's inside the foreach loop and adjust to your code accordingly. 0 Quote Link to comment Share on other sites More sharing options...
Sonu2007 Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks working prefect 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.