Skip to main content
Known Participant
November 4, 2009
Answered

How to output Qurey to table

  • November 4, 2009
  • 1 reply
  • 400 views

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 ?

    This topic has been closed for replies.
    Correct answer ilssac

    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>

    1 reply

    ilssac
    ilssacCorrect answer
    Inspiring
    November 4, 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>