I tried using the code below but it stick an extra colum between my output. Any chance on getting a quick fix?
Jamie
Steve Onnis wrote:
Well technically it should be more like this
<table> <tr> <!--- Set counter ---> <cfset rowCounter = 0> <!--- Output query ---> <cfoutput query="qGetHandsets" group="SeriesID"> <!--- Increment Counter for MOD call ---> <cfset rowCounter = rowCounter + 1> <td> <b>#SeriesName#</b><br> <cfoutput>#ModelName#<br></cfoutput> </td> <!--- If we have 2 cells but not at the end of the recordset ---> <cfif rowCounter MOD 2 EQ 0 AND CurrentRow NEQ RecordCount> </tr> <tr> </cfif> <!--- If we have finished our output but we dont have 2 cells, then add one to finish the row ---> <cfif rowCounter MOD 2 NEQ 0 AND CurrentRow NEQ RecordCount> <td> </td> </cfif> </cfoutput> </tr> </table>
Steve
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of James Macpherson Sent: Wednesday, September 03, 2003 4:41 PM To: CFAussie Mailing List Subject: [cfaussie] Re: Output display problem
correct me if I'm wrong but won't that produce invalid HTML?
(eg. a <tr> opened but not closed)
code should read
<table> <tr> <cfset rowCounter = 0> <cfoutput query="qGetHandsets" group="SeriesID"> <cfset rowCounter = rowCounter + 1>
<td> <b>#SeriesName#</b><br> <cfoutput>#ModelName#<br></cfoutput> </td> <cfif rowCounter MOD 2 IS 0> </tr> <tr> </cfif> </cfoutput> </tr> </table>
-----Original Message----- From: Jamie Strachan [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 4:21 PM To: CFAussie Mailing List Subject: [cfaussie] Re: Output display problem
Steve it worked, thanks heaps
Jamie
Steve Onnis wrote:
try this
<table> <tr> <cfset rowCounter = 0> <cfoutput query="qGetHandsets" group="SeriesID"> <cfset rowCounter = rowCounter + 1>
<td> <b>#SeriesName#</b><br> <cfoutput>#ModelName#<br></cfoutput> </td> <cfif rowCounter MOD 2 IS 0> </tr> <tr> </cfif> </cfoutput> </table>
Cause your grouping your output, the CurrentRow value wont work for you cause currentRow also incrments within the inner cfoutput. You need to
set
another var that increments only when the outer cfoutput is looping
Regards Steve Onnis
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Jamie Strachan Sent: Wednesday, September 03, 2003 3:43 PM To: CFAussie Mailing List Subject: [cfaussie] Output display problem
Hi All,
I have got a simple query that groups models of telephone by the series they belong to. My client would like to have the output shown side by side in a simple 2 column display. I have tried to use a method i use all the time for this but i am having some troubles witht the output
Current Output *************************** Series Name Model Model Model ---------------- Series Name Model Model Model ---------------- Series Name Model Model Model
Desired Output *************************** Series Name Series Name Model Model Model Model Model Model ---------------------------------- Series Name Series Name Model Model Model Model Model Model
The code that i am using for the desired output is below but it throws the tables all over the place, i think it has something to do with the grouping.
Current Code Used for Output ******************************
<cfquery name="qGetHandsets" datasource="mydsource"> select m.ModelSeriesID, m.ModelName, s.SeriesID, s.SeriesName from HANDSETSERIES s, HANDSETMODELS m where m.ModelSeriesID = s.SeriesID order by s.SeriesID </cfquery>
<table> <tr> <cfoutput query="qGetHandsets" group="SeriesID"> <td> <b>#SeriesName#</b><br> <cfoutput>#ModelName#<br></cfoutput> </td> <cfif qGetHandsets.CurrentRow MOD 2 IS 0> </tr> <tr> </cfif> </cfoutput> </table>
Thanks for any feedback/help
Jamie
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to
[EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
