This content has been marked as final.
Show 1 reply
-
1. Re: Aligning multiple lists
ilssac Sep 28, 2009 1:01 PM (in response to ilssac)Well I came up with one way.
<!--- loop over and create master list of unique values by creating a temp structure ---> <cfset masterList = structNew()> <cfloop collection="#positions#" item="type"> <cfloop list="#structKeyList(positions[type])#" index="item"> <cfset masterList[item] = ""> </cfloop> </cfloop> <!--- extract master list ---> <cfset masterList = listSort(structKeyList(masterList),"textNoCase")> <cfoutput> <table border="1"> <tr> <cfloop list="#listSort(structKeyList(positions),'textNoCase')#" index="type"> <th>#type#</th> </cfloop> </tr> <!--- loop over master list to display table of all elements ----> <cfloop list="#masterList#" index="key"> <tr> <!--- loop over each of the contributint lists ---> <cfloop collection="#positions#" item="type"> <!--- if the current list has the current item, display item ---> <td><cfif structKeyExists(positions[type],key)>#key#</cfif></td> </cfloop> </tr> </cfloop> </table> </cfoutput>

