|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
little coding prob...
ok, this here is my code:
Code:
<table width="90%" cellpadding="5" cellspacing="5" border="1"> <tr> <cfoutput query="myquery" group="category"> <td width="33%" valign="top"> <p align="center"><strong>#category#</strong></p> <cfoutput> #field1#, #field2# <hr> </cfoutput> </td> <cfif not myquery.currentRow MOD 3> </tr> <tr> </cfif> </cfoutput> </tr> </table> usually this would output my query results in 3 columns, but apparantly the grouping is throwing this off, it comes out in this hideous mass of cells all over the place. anyone know how to fix this???? thanks! later |
|
#2
|
|||
|
|||
|
I'm not sure what format you're trying for? Do you want 3 table columns? Like this?
<tr> <td>category1<td> <td>field1<td> <td>field2<td> </tr> Keep in mind that to use the "group" attribute you must be ordering your query by that column as well. |
|
#3
|
|||
|
|||
|
no, like this:
<tr> <td> category1 field1, field2 </td> <td> category2 field1, field2 </td> <td> category3 field1, field2 </td> </tr> <tr> <td> category4 field1, field2 </td> <td> category5 field1, field2 </td> <td> category6 field1, field2 </td> </tr> thanks! |
|
#4
|
|||
|
|||
|
Well then, as long as your query is ordered by category, you should be able to do it like this:
<table> <cfoutput query="myquery" group="category"> <tr> <td> #myQuery.category# <cfoutput> #field1# #field2# </cfoutput> </td> </tr> </cfoutput> </table> Basically everything inside the outer cfoutput block, but not inside the inner cfoutput block, will only execute once for each category. But the code in the inner cfouput block will execute for each data row present for each category. Last edited by kiteless : January 15th, 2004 at 12:33 PM. |
|
#5
|
|||
|
|||
|
ok, maybe a visual aid will help...
i don't want my table like this: ![]() but like this: ![]() does this help?? thanks again!! later |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > little coding prob... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|