Skip to main content
Inspiring
November 16, 2008
Question

How do I put this output into a table ?

  • November 16, 2008
  • 2 replies
  • 355 views
I query a table and output using the following :
<cfoutput query="qryAreas" group="state">#state#<br>
<cfoutput group="city"> #site#<br><cfoutput>  #zipcode#<br></cfoutput><p>
</cfoutput>
</cfoutput>

Since this is dynamic, the output gives me one column all the way down to the end of the page/screen.

How do I dynamically output this into a table with two or three columns, displaying the same data as above ?

I can probably do individual queries and put each one into a <td> but there has to be a better way to do this dynamically.
    This topic has been closed for replies.

    2 replies

    Inspiring
    November 16, 2008
    What about this?

    <cfoutput query="qryAreas" group="state">
    <h2>#state#</h2>
    <cfoutput group="city"> <h3>#site#</h3>
    <p><cfoutput>#zipcode#  </cfoutput><p>
    </cfoutput>
    </cfoutput>
    Inspiring
    November 16, 2008
    what exactly do you want to display in 2/3/4-column layout? which of
    your query columns?

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    trojnfnAuthor
    Inspiring
    November 16, 2008
    My current output, without table, list the first state, then the first city under that state, then all zipcode for that city. It then list the second city for that state and all zipcodes for that city, When all the cities are exhausted for that state, it skips a line and then lists the next state, city, etc., and starts the process all over again. It gives me one column to the end of the screen.

    So for each td, I would like to have the state, the cities and zipcode, then the next td would have the next state, all cites and zipcodes, etc. I would not know how many states are in the table, so each td should contain a state.