Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to output Qurey to table

New Here ,
Nov 04, 2009 Nov 04, 2009

I have a query which output 100 records instead of display 100 in one row I am trying to display in matrix form like 20X5 but I am unable to do

any suggestion ?

346
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Nov 04, 2009 Nov 04, 2009

The usual method for this type of problem is to use the mod operator.

<table>

<tr>

<cfoutput query='my100records'>

     <td>#aValue#</td>

     <cfif my100Records.currentRow mod 20 eq 0>

     <!--- the current row is evenly divisable by 20, start a new row --->

          </tr>

          <tr>

     </cfif>

</cfoutput>

</tr>

</table>

Translate
Valorous Hero ,
Nov 04, 2009 Nov 04, 2009
LATEST

The usual method for this type of problem is to use the mod operator.

<table>

<tr>

<cfoutput query='my100records'>

     <td>#aValue#</td>

     <cfif my100Records.currentRow mod 20 eq 0>

     <!--- the current row is evenly divisable by 20, start a new row --->

          </tr>

          <tr>

     </cfif>

</cfoutput>

</tr>

</table>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources