Solved

Display A Grouped Query in Columns

Posted on 2003-12-09
35
294 Views
Last Modified: 2013-12-24
I need help with formatting this output.  All i want to do is display the grouped queryies into a two column format.  Right now it is in the following format

2003

January
Febuary
March
April
May
June
blah blah blah

2002

January
Febuary
March
April
May
June
blah blah blah




I want it to look like this


2003

January           April
February         May
March             June


2002

January           April
February         May
March             June


How can I format a grouped query to have its data go into two columns.  The data i am outputting will show the dates for about 10 years.  So from 2003 all the way back to about 1993.


Here is my current code:


CFQUERY NAME="getIssues" datasource="#DataTables#">
   select datepart(year, IssueDate) as 'theYear', IssueDate , IsLive, IsSupplement, IsStudyGuide, IssueID, IssueTitle
   from Issues
   WHERE IsLive = '1' AND IsSupplement = '0' AND IsStudyGuide = '0'
   order by datepart(year, IssueDate) desc, IssueDate asc
</CFQUERY>

<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
      <TR>
        <TD class="TDtitle">&nbsp;ASiM Programs</TD>
      </TR>
      <TR>
        <TD>
<TABLE width="100%" border="0">
  <TR align="center">
    <TD colspan="4" class="TDdashed">The Office of Continuing Medical Education at Johns Hopkins University School of Medicine offers <STRONG>Advanced Studies <EM>in</EM> Medicine</STRONG> programs in the following areas:</TD>
  </TR>

  <TR>
    <TD colspan="4">&nbsp;</TD>
  </TR>
  <TR valign="top">
<td>

<cfoutput query="getIssues" group="theYear">
<table>
 <tr><td colspan="2"><strong><font color="##0066CC">#getIssues.theYear#</font></strong></td></tr>
   <cfoutput>
   <tr valign="top"><td class="title" nowrap>
   - <a href="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</a></td>
      </td></tr>  
   </cfoutput>
</table><br>
</cfoutput>

</td>


</td>
  </TR>
</TABLE>
0
Comment
Question by:jeffmace
  • 14
  • 12
  • 8
  • +1
35 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9908288
take a look at this snippet, jusr cahnge teh query name and fields

<cfloop query="getTraining">
            <cfif getTraining.currentrow eq 1>
            <td width="50%">
                  <table cellspacing="0" width="100%">
            </cfif>      
            
                        <tr valign="top">
                              <td class="trn">#CID#</td>
                              <td class="trn">#CNAME#</td>
                              <td class="trn">#dateFormat(CTDATE,"mm/dd/yyyy")#</td>
                        </tr>
            <cfif getTraining.Currentrow EQ #round(evaluate(getTraining.recordCount/2))#>
                  </table>
            </td>
            <td width="50%">
                  <table cellspacing="0" width="100%">
            </cfif>
                  <cfif getTraining.currentrow eq getTraining.recordCount >
                  </table>
            </td>
            </cfif>
            </cfloop>
0
 
LVL 17

Expert Comment

by:Tacobell777
ID: 9909449
You do something like

<cfset middle = ceiling(yourQuery.recordCount/2)>
<table>
<cfloop from="1" to="#variables.middle#" index="i">
<tr>
      <td>#yourQuery.yourColumn[variables.i]#</td>
      <cfset thisItteration = variables.i + variables.middle>
      <td><cfif variables.thisItteration NEQ yourQuery.recordCount>#yourQuery.yourColumn[variables.i + variables.thisItteration]#</cfif></td>
</tr>
</cfloop>
</table>

I believe thats right, Ive done it before, just typed it in the textbox here so did not test it..
0
 

Author Comment

by:jeffmace
ID: 9909470
But will this work with a grouped query??  If you look at my code there is a group involved.  I will work with this to see if it does work, but I am not sure if the grouping will mess it up
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9909947
change ur code to this

<CFOUTPUT query="getIssues" group="theYear">
      <TABLE>
            <TR>
                  <TD colspan="2"><STRONG><FONT color="##0066CC">#getIssues.theYear#</FONT></STRONG></TD>
            </TR>
            <CFOUTPUT>
                  <TR valign="top">
                        <TD class="title" nowrap>-
                              <A href="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</A>
                        </TD>
                        <CFIF CURRENTROW MOD 2 EQ 0>
                              </TR>
                              <TR>
                        </CFIF>
                  </TR>
            </CFOUTPUT>
      </TABLE>
</CFOUTPUT>

PS : I am assuming that ur other part  of the code is working fine
the one i suggested above - is just gonna format the data in 2 columns !

let me know

K'Rgds
Anand
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9909969
Sorry change that to

<CFOUTPUT query="getIssues" group="theYear">
      <TABLE>
            <TR>
                  <TD colspan="2"><STRONG><FONT color="##0066CC">#getIssues.theYear#</FONT></STRONG></TD>
            </TR>
            <CFOUTPUT>
                  <TR valign="top">
                        <TD class="title" nowrap>-
                              <A href="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</A>
                        </TD>                        
                  <CFIF CURRENTROW MOD 2 EQ 0>
                        </TR>
                        <TR>
                  </CFIF>
            </CFOUTPUT>
            </TR>
      </TABLE>
</CFOUTPUT>
0
 

Author Comment

by:jeffmace
ID: 9912232
Anandkp, the code that you have is still formatting it the same way the mine is.

http://www.jhasim.net/output_example.jpg
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9918188
ok how abt this one ! [it has to work]

try it & let me know ...

<CFOUTPUT QUERY="getIssues" GROUP="theYear">
<TABLE>
      <TR>
            <TD COLSPAN="2"><STRONG><FONT COLOR="##0066CC">#getIssues.theYear#</FONT></STRONG></TD>
      </TR>
      <TR VALIGN="top">
            <CFOUTPUT>
                  <TD CLASS="title" NOWRAP>
                        <A HREF="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</A>
                  </TD>
                  <CFIF CURRENTROW MOD 2 EQ 0>
                        </TR>
                        <TR>
                  </CFIF>
            </CFOUTPUT>
            <!--- If CurrentRow dosent work - use a counter & increment the value [as group query may bypass some rows eliminated by the group attribute] --->
      </TR>
</TABLE>
</CFOUTPUT>
0
 

Author Comment

by:jeffmace
ID: 9918248
It works!  It is putting it into columns, but I am just wondering if you can help me get the two columns to align at the top.  I have been trying the valign=top code, but that isn't doing anything.

Here is a image:
http://www.jhasim.net/column_output.jpg


0
 
LVL 17

Expert Comment

by:anandkp
ID: 9918300
the gaps are bcos of the group attribute - I mentioned above.
u have 2 records in January -then one each for rest of the months i guess & then again 2 records for Nov/dec ...
just guessing from the output.

valign = top - wont work here  - we need to play with the cells & not their alignment !

The following may work - but i am not too certain abt it -as i cannot chk it with ur query ...

<CFSET CTR = 0>
<CFOUTPUT QUERY="getIssues" GROUP="theYear">
<TABLE>
     <TR>
          <TD COLSPAN="2"><STRONG><FONT COLOR="##0066CC">#getIssues.theYear#</FONT></STRONG></TD>
     </TR>
       <CFSET CTR = INCREMENTVALUE(CTR)>
       <!--- Using a counter instead of currentrow - to try & avoid the gaps caused by group atttribute --->
     <TR VALIGN="top">
          <CFOUTPUT>
               <TD CLASS="title" NOWRAP>
                    <A HREF="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</A>
               </TD>
               <CFIF CTR MOD 2 EQ 0>
                    </TR>
                    <TR>
               </CFIF>
          </CFOUTPUT>
     </TR>
</TABLE>
</CFOUTPUT>

let me know ....
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9918506
Or try this ...

<CFOUTPUT QUERY="getIssues" GROUP="theYear">
<TABLE>
            <TR>
                  <TD COLSPAN="2"><STRONG><FONT COLOR="##0066CC">#getIssues.theYear#</FONT></STRONG></TD>
            </TR>            
            <TR VALIGN="top">
                  <CFSET CTR = 1>
                  <CFOUTPUT>
                        <TD CLASS="title" NOWRAP><A HREF="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#">#IssueTitle#</A></TD>
                        <CFIF CTR MOD 2 EQ 0>
                              </TR>
                              <TR>
                        </CFIF>
                        <CFSET CTR = INCREMENTVALUE(CTR)>
                  </CFOUTPUT>
            </TR>
</TABLE>
</CFOUTPUT>

Hth

K'Rgds
Anand
0
 

Author Comment

by:jeffmace
ID: 9920161
just to clear up your question about having 2 records for nov/dec.  It is actually 1 record.  I just have a title field that calls it November/December and July/August.  It is just a double issue that counts as 1.

I am going to try the code now.
0
 

Author Comment

by:jeffmace
ID: 9920198
The first example did not work but the 2nd one did.  I am just wondering if it would be possible to change the order that its coming in.

Right now it is going:

January            February
March              April
May                 June
July/August      September
October           November/December

Would it be possilbe for it to go

January            June
February          July/August
March              September
April                October          
May                 November/December
0
 
LVL 17

Accepted Solution

by:
anandkp earned 500 total points
ID: 9920485
I had a feeling the first example wont work - as its was within a grp query ... but with 2nd one ive used a counter to sort things up !

Glad it finally worked for u !

i dont understand why u wanna chnage the order ... people normally read letf-right & not top-bottom !
0
 

Author Comment

by:jeffmace
ID: 9920588
your right, I may leave it as is, but I am just wondering if it is possible for to show me in case I would like to change it.  I will try to figure it out on my own, but would be greatful if you have the time.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9925930
The top-down order is a tricky one ... a bit more difficult than the left-right !

I wld work on it & get back to u asap !
0
 

Author Comment

by:jeffmace
ID: 10132316
anandkp, I am just wondering if you have anytime in looking at this code again to try to figure out a way to do the top-down order.  I will obviously throw points your way for your help if you have time
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10133384
i know you posted this for anand but look at this, it's also the first code i posted, and it goes top to bottom left to right and puts the second column in at 50% of the output or 50% +1 on odd counts, so on odd counts the left colum would be one more than the right
<table>
</tr>
      <cfquery name="getTraining" datasource="1297_SQL_HR_ID" password="employee" username="HR_APP">
            SELECT VTRAING.CourseId as CID, CourseList.TNG_NA as CNAME, max(VTRAING.TrainDate) as CTDATE
            FROM VTRAING LEFT JOIN CourseList ON VTRAING.CourseId = CourseList.TNG_SYS_NR
            WHERE VTRAING.EmpId = '#empLookupId#'
            GROUP BY VTRAING.CourseId, CourseList.TNG_NA
            ORDER BY max(VTRAING.TrainDate) DESC
      </cfquery>
      <tr>
      <cfloop query="getTraining">
            <cfif getTraining.currentrow eq 1>
            <td width="50%">
                  <table cellspacing="0" width="100%">
            </cfif>      
            
                        <tr valign="top">
                              <td class="trn">#CID#</td>
                              <td class="trn">#CNAME#</td>
                              <td class="trn">#dateFormat(CTDATE,"mm/dd/yyyy")#</td>
                        </tr>
            <cfif getTraining.Currentrow EQ #round(evaluate(getTraining.recordCount/2))#>
                  </table>
            </td>
            <td width="50%">
                  <table cellspacing="0" width="100%">
            </cfif>
                  <cfif getTraining.currentrow eq getTraining.recordCount >
                  </table>
            </td>
            </cfif>
            </cfloop>
      </tr>
</table>

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:anandkp
ID: 10135060
@Jester - good one ... I have just played a bit with ur code to make it more reliable ! I hope u dont mind it ! let me know ...

1. This shldnt look Haphazard with uneven no of records.
2. Well distributed - with a fake blank row at the end to make both tables look evenly distributed.
3. Cellspacing & table height to make it even spaced

<BASEFONT FACE="verdana" SIZE="2">

<CFQUERY NAME="Qry_Style" DATASOURCE="Dsn">
      select top 17
      styleid,styleno,styleimgs from tbl_style_m       
</CFQUERY>

<CFOUTPUT>
<TABLE BORDER="0" BGCOLOR="Navy" WIDTH="500" CELLPADDING="0" CELLSPACING="1">
      <TR>
            <TD WIDTH="50%">
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                  <CFLOOP QUERY="Qry_Style">
                        <TR VALIGN="top" BGCOLOR="White">
                              <TD WIDTH="30%">#styleid#</TD>
                              <TD WIDTH="70%">#styleno#</TD>                        
                        </TR>
                        <CFIF CURRENTROW EQ ROUND(EVALUATE(RECORDCOUNT/2))>
                  </TABLE>
            </TD>
            <TD WIDTH="50%" VALIGN="top">                  
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                        </CFIF>
                        <CFIF CURRENTROW EQ RECORDCOUNT AND QRY_STYLE.RECORDCOUNT MOD 2 NEQ 0>
                              <TR VALIGN="top" BGCOLOR="White">
                                    <TD WIDTH="30%">&nbsp;</TD>
                                    <TD WIDTH="70%">&nbsp;</TD>                        
                              </TR>
                  </TABLE>
            </TD>
                        </CFIF>
                  </CFLOOP>
                  
      </TR>
</TABLE>
</CFOUTPUT>

K'Rgds
Anand
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10135078
Sorry missed out a CFELSE condition

<BASEFONT FACE="verdana" SIZE="2">

<CFQUERY NAME="Qry_Style" DATASOURCE="OAGN_Dsn">
      select top 18
      styleid,styleno,styleimgs from tbl_style_m       
</CFQUERY>

<CFOUTPUT>
<TABLE BORDER="0" BGCOLOR="Navy" WIDTH="500" CELLPADDING="0" CELLSPACING="1">
      <TR>
            <TD WIDTH="50%">
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                  <CFLOOP QUERY="Qry_Style">
                        <TR VALIGN="top" BGCOLOR="White">
                              <TD WIDTH="30%">#styleid#</TD>
                              <TD WIDTH="70%">#styleno#</TD>                        
                        </TR>
                        <CFIF CURRENTROW EQ ROUND(EVALUATE(RECORDCOUNT/2))>
                  </TABLE>
            </TD>
            <TD WIDTH="50%" VALIGN="top">                  
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                        </CFIF>
                        <CFIF CURRENTROW EQ RECORDCOUNT AND QRY_STYLE.RECORDCOUNT MOD 2 NEQ 0>
                              <TR VALIGN="top" BGCOLOR="White">
                                    <TD WIDTH="30%">&nbsp;</TD>
                                    <TD WIDTH="70%">&nbsp;</TD>                        
                              </TR>
                  </TABLE>
            </TD>
                        <CFELSEIF CURRENTROW EQ RECORDCOUNT>
                  </TABLE>
            </TD>
                        </CFIF>
                  </CFLOOP>
                  
      </TR>
</TABLE>
</CFOUTPUT>

K'Rgds
Anand
0
 

Author Comment

by:jeffmace
ID: 10135139
Anandkp, how would this work with a grouped query as in my case.

<CFQUERY NAME="getIssues" datasource="#DataTables#">
   select datepart(year, IssueDate) as 'theYear', IssueID, IssueTitle
   from Issues
   WHERE IsLive = '1'
   order by datepart(year, IssueDate) desc, IssueDate asc
</CFQUERY>

<CFOUTPUT QUERY="getIssues" GROUP="theYear">
<TABLE align="center" width="550">
          <TR>
               <TD COLSPAN="2" class="redHeader"><STRONG>#getIssues.theYear#</STRONG></TD>
          </TR>          
          <TR VALIGN="top">
               <CFSET CTR = 1>
               <CFOUTPUT>
                    <TD NOWRAP class="defaultLarge" width="275"><A HREF="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#"><STRONG>#IssueTitle#</STRONG></A></TD>
                    <CFIF CTR MOD 2 EQ 0>
                         </TR>
                         <TR>
                    </CFIF>
                    <CFSET CTR = INCREMENTVALUE(CTR)>
               </CFOUTPUT>
          </TR>
</TABLE><br>
</CFOUTPUT>
0
 

Author Comment

by:jeffmace
ID: 10135160
Jester, I am working with yours as well, and I am not understanding how to workin in my grouping situation.  Here is an image of what the current format looks like.  I would like to keep the current format, but just change the way the months are ordered.

Image:
http://www.jhasim.net/issue_image.jpg

Thank you,
Jeff
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10135246
Hi Jeff,

try this - this shld hopefully work

<CFQUERY NAME="getIssues" datasource="#DataTables#">
   select datepart(year, IssueDate) as 'theYear', IssueID, IssueTitle
   from Issues
   WHERE IsLive = '1'
   order by datepart(year, IssueDate) desc, IssueDate asc
</CFQUERY>

<TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
      <CFOUTPUT QUERY="getIssues" GROUP="theYear">
      <TR VALIGN="top" BGCOLOR="White">
            <TD COLSPAN="2" class="redHeader"><STRONG>#getIssues.theYear#</STRONG></TD>                        
      </TR>
      <CFSET Ctr = 1>
      <TR>
            <TD WIDTH="50%">
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">            
                  <CFOUTPUT>
                  
                        <TR VALIGN="top" BGCOLOR="White">                              
                              <TD COLSPAN="2" class="redHeader"><STRONG>#getIssues.theYear#</STRONG></TD>
                        </TR>
                  <CFIF Ctr MOD 2 EQ 0>
                  </TABLE>
            </TD>
            <TD WIDTH="50%" VALIGN="top">                  
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                  </CFIF>
                  <CFSET Ctr = IncrementValue(Ctr)>
                  
                  </CFOUTPUT>            
                  </TABLE>
            </TD>            
      </CFOUTPUT>
      </TR>
</TABLE>            

K'Rgds
Anand
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10135248
Ignore earlier - change it to this :

<CFQUERY NAME="getIssues" datasource="#DataTables#">
   select datepart(year, IssueDate) as 'theYear', IssueID, IssueTitle
   from Issues
   WHERE IsLive = '1'
   order by datepart(year, IssueDate) desc, IssueDate asc
</CFQUERY>

<TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
      <CFOUTPUT QUERY="getIssues" GROUP="theYear">
      <TR VALIGN="top" BGCOLOR="White">
            <TD COLSPAN="2" class="redHeader"><STRONG>#getIssues.theYear#</STRONG></TD>                        
      </TR>
      <CFSET Ctr = 1>
      <TR>
            <TD WIDTH="50%">
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">            
                  <CFOUTPUT>
                  
                        <TR VALIGN="top" BGCOLOR="White">                              
                              <TD NOWRAP class="defaultLarge" width="275"><A HREF="template.cfm?template=include_viewissue.cfm&ID=#ISSUEID#"><STRONG>#IssueTitle#</STRONG></A></TD>
                        </TR>
                  <CFIF Ctr MOD 2 EQ 0>
                  </TABLE>
            </TD>
            <TD WIDTH="50%" VALIGN="top">                  
                  <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
                  </CFIF>
                  <CFSET Ctr = IncrementValue(Ctr)>
                  
                  </CFOUTPUT>            
                  </TABLE>
            </TD>            
      </CFOUTPUT>
      </TR>
</TABLE>      
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10135693
>>@Jester - good one ... I have just played a bit with ur code to make it more reliable ! I hope u dont mind it ! let me know ...
not a bit, thats how EE works, building on pevious learning, at least you gave me credit for the base code, some users just reuse code with some variable changes, hoping the original poster wont notice,what really sucks is when
1) someone reposts your code in the same thread without saying 'here's xyz's code with a few changes,...."
2) someone reposts YOUR code, without the credit line, just changes a variable or two and their answer gets accepted
you have no idea how many times both those situations have happened to me
and thanks for the good word... i do have occassional flashes of brilliance,:-), and it's nice to get some good feedback, points are nice too,;-}, but i'm not in the cf ta enough, but i am working on getting my certified ee expert in cf, only about 8000 points to go!!

@jeffmace
at the link you sent me you had the view source disabled, this is only the second site i have seen this at, the first was an intranet at my company, and they wouldn't tell me how it was done, so ....
where did you get the code/activeX that does this, i have been desparately looking for this, this is very important since this week we found that another developer had copied the source code for over thirty of our pages and had movrd them onto ther departments intranet, i need to prevent this in the future and a reference or the code would be great!!
TIA
0
 

Author Comment

by:jeffmace
ID: 10135739
I think the view source is diabled becuase there is no source to view.  Its just a link to an image.

Jester your code is just about there, he is link to show what it is doing.

http://www.jhasim.net/template.cfm?TEMPLATE=include_viewissues2.cfm
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10136470
>>Its just a link to an image.

doh!, didn't even look, just thought it was a test page

ok so the output code is exceeding the width of the header... correct?

ok

instead of this
<TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">
     
     <TR VALIGN="top" BGCOLOR="White">
          <TD COLSPAN="2" class="redHeader"><STRONG>2004</STRONG></TD>                    
     </TR>
     
     <TR>
          <TD WIDTH="50%">
               <TABLE CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" HEIGHT="100%">          
               
               
                    <TR VALIGN="top" BGCOLOR="White">                        
                         <TD NOWRAP class="defaultLarge" width="275"><A HREF="template.cfm?template=include_viewissue.cfm&ID=5"><STRONG>January</STRONG></A></TD>
                    </TR>
                         
               </TABLE>
          </TD>          
     
     <TR VALIGN="top" BGCOLOR="White">
          <TD COLSPAN="2" class="redHeader"><STRONG>2003</STRONG></TD>                    
     </TR>
     ...
</table>
make your years output into nested tables, this will avois the exess width problem as each table will occupy 100% of the cell in its parent table









0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10136546
alsothe original code was for a two colum display of infinite length, what you are trying to make is a two row display of upto 6 wide

so you need to change the
<TD WIDTH="50%"> to just <td>
and
<TD NOWRAP class="defaultLarge" width="275"><A HREF="template.cfm?template=include_viewissue.cfm&ID=5"><STRONG>January</STRONG></A></TD>
to
<TD NOWRAP class="defaultLarge"><A HREF="template.cfm?template=include_viewissue.cfm&ID=5"><STRONG>January</STRONG></A></TD>
remove the width attribute

and
<TR VALIGN="top" BGCOLOR="White">
          <TD COLSPAN="2" class="redHeader"><STRONG>2003</STRONG></TD>                    
     </TR>
this will alway only provide a span of 2 columns but your output is upto 6
so ...
one way around the column span problem is to use a caption
<caption class="redHeader"><STRONG>2003</STRONG></caption>
this will alway span the width of teh table, no matter teh number of columns in the table
you will need to rework some of your code to implement the caption idea, but it works very well, i use it in a table setup where through user selections a able can either have 4 or 5 comlumns so rather that calculate the nuber of columns each time and change the colspan in a th i use the caption which spans accross all columns                    
0
 

Author Comment

by:jeffmace
ID: 10138963
I am not sure why you made this statement:

"alsothe original code was for a two colum display of infinite length, what you are trying to make is a two row display of upto 6 wide"

I do only want a 2 column display of infinite length.  Just like what you see below and just like the output i had in the beginning.  The only problem with the code that anand gave me was that it was displaying from left to right instead of top to bottom which is what i would like to have.

2003

January           April
February         May
March             June


2002

January           April
February         May
March             June
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10139127
but the output in the link you gave me is 6 wide and two high,

if you want 6 high X 2 wide there would seem to be an extra closing tag in the code
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10139138
try changing this

  <CFIF Ctr MOD 2 EQ 0>

to this

  <CFIF Ctr MOD 6 EQ 0>
0
 

Author Comment

by:jeffmace
ID: 10139214
Perfect, brilliant!!  Thank you very much!

Jeff
0
 

Author Comment

by:jeffmace
ID: 10139216
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10139590
:(
0
 

Author Comment

by:jeffmace
ID: 10139978
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10140260
glad i could help
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now