| Display Records Horizontally ASP Script - ASP Web Pro |
|
ASP ScriptsDISPLAY RECORDS HORIZONTALLYOk, when it comes to displaying records from a database on a web page, we can all agree that using a table to organize your data is one of the most commonly used methods. Today, most websites use tables to display their records vertically. However, depending on the type of data that you are displaying or the layout of your page, you may need to display your records horizontally. So how do you do this. Actually it's not that hard. The first thing you need to do is create a database called
MyDatabase. Then, create a table called tblData with these
fields: Next, create a page called displayhoriz.asp and copy the below code into your page:
This script will return all of the records in your tblData table and display them in a table on your page. Plus, it will display three records horizontally in a table row and then end the current row, start a new row, and display three more records. If you want to display more records horizontally, simply change the "3" in this line: IF recCount Mod 3 = 0 THEN to however many records you want to display in each row. Happy record displaying!
|
|||
|
Main Menu Other Resources
Last Updated:
|
|||
|
© 1997-2008 ASP Web Pro, Inc. | Terms of Use
|