hellomyfriends Posted June 28, 2011 Share Posted June 28, 2011 The code below: {php $CATEGORY = cache_read('category-'.$mid.'.php');} <table width="100%" cellspacing="0" cellspacing="0"> {php $child = get_maincat(0, $CATEGORY, 1);} {loop $child $i $c} {if $i%2==0}<tr{if $i%4==2} bgcolor="#FAFCFE"{/if}>{/if} <td valign="top" width="50%" onmouseover="this.style.backgroundColor='#E2F0FB';" onmouseout="this.style.backgroundColor='';"> <p> <a href="{$MODULE[$mid][linkurl]}{$c[linkurl]}" class="px15"><strong>{set_style($c[catname], $c[style])}</strong></a> {if $c[child]} {php $sub = get_maincat($c[catid], $CATEGORY, 2);} {loop $sub $j $s}{if $j < 5} <a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}"><strong>{set_style($s[catname], $s[style])}</strong></a>{/if}{/loop} {/if} </p> {if $c[child]} {php $sub = get_maincat($c[catid], $CATEGORY, 1);} <ul> {loop $sub $j $s} <li><a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" class="g">{set_style($s[catname], $s[style])}</a></li> {/loop} {if $j>10}<li><a href="{$MODULE[$mid][linkurl]}{$c[linkurl]}" class="g">All</a></li>{/if} </ul> <div class="c_b"></div> {/if} </td> {if $i%2==1}</tr>{/if} {/loop} </table> The images attached. Plz help me split Subcategories Data into 2 columns Sub 1 | Sub 4 Sub 2 | Sub 5 Sub 3 | Thanks a lot. Terry Tran [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/240597-plz-help-me-split-subcategories-data-into-2-columns/ Share on other sites More sharing options...
hellomyfriends Posted June 29, 2011 Author Share Posted June 29, 2011 Bump!!!! Please help! Quote Link to comment https://forums.phpfreaks.com/topic/240597-plz-help-me-split-subcategories-data-into-2-columns/#findComment-1236139 Share on other sites More sharing options...
Pikachu2000 Posted June 29, 2011 Share Posted June 29, 2011 Users should not "bump" topics that are still on the first page of the forums. If you bump' date=' you must provide additional information[/color']. If you resort to bumping, chances are your question needs to be re-thought and re-described (see Eric Raymond's "How To Ask Questions The Smart Way"). Quote Link to comment https://forums.phpfreaks.com/topic/240597-plz-help-me-split-subcategories-data-into-2-columns/#findComment-1236142 Share on other sites More sharing options...
hellomyfriends Posted June 29, 2011 Author Share Posted June 29, 2011 Thank Pikachu2000 alot. I'd like to split default subcategories (attached image) into 2 columns with the code above. Sub 1 | Sub 4 Sub 2 | Sub 5 Sub 3 | Thanks for the support. Terry Quote Link to comment https://forums.phpfreaks.com/topic/240597-plz-help-me-split-subcategories-data-into-2-columns/#findComment-1236216 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.