There are many ways to skin this, this is how I do these kinds of things. Feels cleaner to me, but doesn't make it better.

<@assign local$myarray <@array value="cat 2, sub 4;cat 1,sub 1;cat 1,sub 2;cat 3,sub 9;cat 1,sub 3;cat 2,sub 5;cat 2,sub 6;cat 3,sub 7;cat 3, sub 8;">>
<@assign local$myarray[0,1] "cats">
<@assign local$myarray[0,2] "subs">
<@assign local$justcats <@distinct local$myarray cols="1 DICT">>
<@sort local$justcats cols=1>
<@comment>now display it</@comment>
<ul>
<@rows array=local$justcats>
<li><@col 1>
<@assign local$thissubs <@filter local$myarray "'#cats' = '<@col 1>'">>
<@sort local$thissubs cols=2>
<ul>
<@rows array=local$thissubs>
<li><@col 2></li>
</@rows>
</ul>
</li>
</@rows>
</ul>


-- 

Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040

On Oct 11, 2006, at 11:56 AM, WebDude wrote:

 
Sorry if this seems so elementary...
 
I have a table that lists categories and subjects - ie...
 
category1    subject1
category1    subject2   
category1    subject3
category2    subject4
category2    subject5   
category2    subject6
category3    subject7
category3    subject8   
category3    subject9
 
How do I display...
 
category1   
    subject1
    subject2   
    subject3
 
category2   
    subject4
    subject5   
    subject6
 
category3   
    subject7
    subject8   
    subject9
 
 
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to