I hope I understand the problem, otherwise this solution will seem simplistic... ;-) NOTE: none of the included code has been tested. It may be buggy as listed.
Assuming you have something like the following: <cfquery name="qryBookList" datasource="#application.dsn#"> SELECT title, author, ... FROM books WHERE title LIKE '#variables.sCurrentLetter#%' </cfquery> The above assumes that you are storing the selected character in a local variabled sCurrentLetter. In order to stick each book in a table column, loop through the query and create each column dynamically. <table> <tr> <cfoutput> <cfloop query="qryBookList"> <td> Title: #title#<br> Author: #author#<br> ... </td> </cfloop> </cfoutput> </tr> </table> This is going to look nutty in a browser though, especially if you have more than a few books. I would suggest moving each book to a row, and only displaying summary information on the listing page. If the user wants to see the full details of the book, make then drill down into a detail page. Hope this helps, --IronFury On Wed, 05 December 2001, phumes1 wrote: > > > Hi, > > How would I go about creating a dynamic table from entries in my database? > > I have book names which I'm pulling from the database and displaying the > results based on where the user clicks on the alphabetical index. > > Just for testing I've created a table with ten <td>...</td> for the listing > of all books that start with the letter "A". Other letters have more or less. > > How can I figure out how many books are being pulled from the database and > use that information to create the correct number of <td>...</td> or even > the complete table from the results? > > ------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com ----------------------------------------------- To post, send email to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org
