Skip to main content
Dani Szwarc
Inspiring
March 14, 2008
Question

cfloop with tables

  • March 14, 2008
  • 2 replies
  • 384 views
Hello guys. I'm trying to generate a table with results from a query. I'm using cfloop to generate this. With on result per row works ok. I'm a bit lost on how to generate the same table but showing 3 results per row instead of one. I guess I have to use nested cfloop, but how?

Any help will be highly appreciated.\

Thanks a lot.

Dani
    This topic has been closed for replies.

    2 replies

    Dani Szwarc
    Inspiring
    March 14, 2008
    Great!!!! Thanks so much Josh!!!!
    Inspiring
    March 14, 2008
    Hi DaniFW,

    This should give you three columns per row...

    <cfoutput>
    <table border="1">
    <tr>
    <cfloop query="qSelect">
    <td>#qSelect.currentRow#</td>
    <cfif qSelect.currentRow MOD 3 EQ 0>
    </tr><tr>
    </cfif>
    </cfloop>
    </tr>
    </table>
    </cfoutput>