BAJI26 Posted March 9, 2008 Share Posted March 9, 2008 How do I get this 2 across: <table width="100%" align="center" cellpadding="2" cellspacing="0" style="border: 1px solid #e0e0e0;"> <tr> {foreach key=num item=product from=$products} <td width="33%" valign="top"><input type="radio" name="pid" value="{$product.pid}" id="product{$product.pid}"{if $product.qty eq "0"} disabled{/if} /> <label for="product{$product.pid}">{$product.name}</label> - {$product.description}<br /> </td> {if $num is div by 2} </tr> <tr> {/if} {/foreach} </tr> </table> I know I'm close but also stuck. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted March 9, 2008 Share Posted March 9, 2008 how do you want it to go? 1 2 3 4 or 1 3 2 4 ? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted March 9, 2008 Author Share Posted March 9, 2008 Like: 1 2 3 4 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted March 10, 2008 Share Posted March 10, 2008 <table width="100%" align="center" cellpadding="2" cellspacing="0" style="border: 1px solid #e0e0e0;"><tr> {foreach key=num item=product from=$products} <td width="50%" valign="top"><input type="radio" name="pid" value="{$product.pid}" id="product{$product.pid}"{if $product.qty eq "0"} disabled{/if} /> <label for="product{$product.pid}">{$product.name}</label> - {$product.description}<br /> </td> {if $num is div by 2} </tr> <tr> {/if} {/foreach} </tr> </table> that shoudl work for you 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted March 10, 2008 Author Share Posted March 10, 2008 I get the same thing, the first row is single, the second is double and the 3rd is single. eg. 1 2 3 4 Can't figure how to get it to: 1 2 3 4 Whatelse can I try?! 0 Quote Link to comment Share on other sites More sharing options...
freedombi Posted March 10, 2008 Share Posted March 10, 2008 Does $num start at 0 or 1? If 0, then you would need to check if $num is not divisible by 2. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted March 10, 2008 Author Share Posted March 10, 2008 Does $num start at 0 or 1? If 0, then you would need to check if $num is not divisible by 2. Thanks that work! 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted March 10, 2008 Share Posted March 10, 2008 Does $num start at 0 or 1? If 0, then you would need to check if $num is not divisible by 2. LOL, good catch. I probably should have looked at it longer than 5 seconds before responding earlier. =P 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted March 10, 2008 Author Share Posted March 10, 2008 Quick Question! Why is it although I have the <table style=[color=red]"width: 100%;"[/color] cellpadding="2" cellspacing="0" style="border: 1px solid #e0e0e0;"> The table doesn't stretch to the end of the page? 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted March 10, 2008 Share Posted March 10, 2008 why in the world are you using style twice? combine those into one. There could also be different attributes that are restricting the width. Can you give us a link to the actual full page? 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted March 10, 2008 Author Share Posted March 10, 2008 I got it, I changed it to width: px 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.