Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you display db items in columns?

Status
Not open for further replies.

artdirectoreric

Instructor
Jun 26, 2001
120
US
I have a catalog database that I'm going to put on a clients website. I want to create a results page that shows items in three columns... like this:

A B C

D E F

G H I

Any suggestions?
 
Question:
Do you want the columns to show different fields from the same file, or different files from the database? This will make a major difference.
 
In my example above, A would be the picture, name and price of the first item in the databse, B would be the picture, name and price of the second item, and so on and so on.
 
Sorry, I've been out of town for a while.
Well, of course the first thought...
If you need this site to get up really quick, the first thing to do is set the design with one item per line, rather than three. Put the picture on the left or something, with description, data, prices, etc on the right. That's really easy, and will get you up and running while you work on improving the design.
 
Some of the stock photo sites have multiple-column database results. That's what I'm looking for.
 
Such a thing is not directly available from MS Front Page, so you have to write this in with notepad or similar editor.

Assuming you understand html language, used on asp pages, here is the code you would need for two columns.
--------------
<%
var row = new Array(&quot;&quot;,&quot;&quot;);
%>
<table>
<% while( !rs.EOF){

row[0] = new String(rs(&quot;doctor&quot;));
rs.MoveNext();
row[1] = (rs.EOF) ? &quot;&quot; : new String(rs(&quot;doctor&quot;));
rs.MoveNext();
%>
<tr><td><%=row[0]%></td><td><%=row[1]%></td></tr>
<% } // while( not recordset eof) %>
</table>
--------------------------
for more columns, you repeat the &quot;row[1]&quot; column, increasing the [1] each time... [1] [2] [3], etc.
Hope that helps.

Dick

 
Great!!
I like your new source site. I just added it to my favorites list for web design.

Have a great day!

Dick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top