Multiple Columns and List Order with Color
i trying take code , enhance by:
1. displays output in 5 column vertical format
output1 output2 output3...
i want display in scrolling 5 column vertical format
output1 output4
output2 output5
output3 output6
based on number of data points
2. want first column background blue, next white, next blue, next white, last blue.
any way accomplish this..appreciate help.
leo
code:
<table width="100%" border="0" cellpadding="7" cellspacing="0">
<tr>
<td colspan="5" align="left" valign="top" bgcolor="#cc6699">
<span class="datetextwhite"><a name="thursday"> </a><span class="style6">thursday, october 29th: pre-conference intensives</span></span></td>
</tr>
<tr>
<cfoutput query="q_daysschedule">
<td valign=top><span class="bodytextbold"><span class="style16"><font face="verdana, arial, helvetica, sans-serif">#q_daysschedule.time#</font></span></span><br /><span class="topnavigationbar"><a href="session.cfm?id=201" class="topnavigationbar">#q_daysschedule.title#</a></span></td>
<cfif q_daysschedule.currentrow mod 5 0>
</tr>
<tr></tr>
</cfif>
</cfoutput>
<tr>
i find these problems easier solve if rearrange data array. this:
dataarray = arraynew(2);
cols = 5;
outputs = "output1,output2,etc";
rows = round(listlen(outputs) / cols + .5); // 32 outputs give 7 rows
for (ii = 1; ii lt cols; ii = ii + 1) {
for (j = 1; j lte rows; j = j + 1) {
dataarray[ii][j] = listfirst(outputs);
outputs = listrestoutputs;
} // rows
} // cols
// last column
for (ii = 1; ii lte listlen(outputs); ii = ii + 1 )
dataarray[cols][ii] = listgetat(outputs, ii);
// put spaces in blank rows
for (j = ii; j lte rows; j = j + 1)
dataarray[cols][j] = " ";
output this
<cfoutput>
<cfloop = "1" = cols index = "thisrow">
<cfloop = "1" = rows index = "thiscol">
#dataarray[thiscol][thisrow]#
closing tags, formatting etc
More discussions in Advanced Techniques
adobe
Comments
Post a Comment