|
Subject:
|
Horizontal Records display
|
|
Posted By:
|
doosti
|
Post Date:
|
11/10/2004 4:11:25 PM
|
I want to display the redcords horizontally in a pair of three.
I meant to say that when i xtract data from the database my result should appear horizontally and not more then three results in a row...
How should i do it...plz if anyone can help me out..
I want the results to be displayed as below:
Record1 Record2 Record3 Record4 Record5 Record6
and so on....... Plz Help.. Thanx
Farzan Q. BS(TeleCommunication) Iqra University.
|
|
Reply By:
|
ChrisScott
|
Reply Date:
|
11/11/2004 3:51:07 AM
|
Hey Farzan,
Try this...
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
If a > 0 Then
If a Mod cols = 0 Then
temp = temp & "</tr><tr>"
End If
End If
temp = temp & "<td>" & rs("myFieldName") & "</td>"
rs.MoveNext
a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,
Chris
|
|
Reply By:
|
doosti
|
Reply Date:
|
11/11/2004 7:28:29 AM
|
quote: Originally posted by ChrisScott
Hey Farzan,
Try this...
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
If a > 0 Then
If a Mod cols = 0 Then
temp = temp & "</tr><tr>"
End If
End If
temp = temp & "<td>" & rs("myFieldName") & "</td>"
rs.MoveNext
a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,
Chris
Greetings Chris,
Thanx for taking interest in my query and letting me know the solution. I will try it and if i get trouble in doing that i will again post here plz do check back..thanx once again!
Farzan Q. BS(TeleCommunication) Iqra University.
|
|
Reply By:
|
doosti
|
Reply Date:
|
11/11/2004 3:59:55 PM
|
quote: Originally posted by ChrisScott
Hey Farzan,
Try this...
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
If a > 0 Then
If a Mod cols = 0 Then
temp = temp & "</tr><tr>"
End If
End If
temp = temp & "<td>" & rs("myFieldName") & "</td>"
rs.MoveNext
a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,
Chris
Hi Chris,
I did it..woo hooo..thanx alot...the way you tought me is so easy thati implemented it in my first try.... Hey could you plz help me in asp paging...do u have any easy code like above for paging....i hope you would help me in paging too:)
Thanx alot!
Farzan Q. BS(TeleCommunication) Iqra University.
|
|
Reply By:
|
ChrisScott
|
Reply Date:
|
11/12/2004 9:54:08 AM
|
Hi Farzan,
Not really sure what you're after.
For paging at it's most straight forward, I would run two queries, one to get the total results and another to get the actual results to display.
If the total results are greater than the number you want to show per page, you can create links to the various pages, forward / next etc.
What have you got so far?
Cheers,
Chris
|
|
Reply By:
|
doosti
|
Reply Date:
|
11/14/2004 6:20:54 AM
|
quote: Originally posted by ChrisScott
Hi Farzan,
Not really sure what you're after.
For paging at it's most straight forward, I would run two queries, one to get the total results and another to get the actual results to display.
If the total results are greater than the number you want to show per page, you can create links to the various pages, forward / next etc.
What have you got so far?
Cheers,
Chris
Hey Chris..first of all thanx once again for visiting here and reading my post...
You understood what i want.... I want to display 5 records per page...after each five records there should be a link as you have mentioned NEXT or BACK...and i m sure you have seen written number of pages on many sites..like first 1 2 3 last...
Anyways...if you can let me know how to display specific number of records on a single page and then a link to next page for next 5 records...i will be thankful..if you had done in any previous projects??
I will be thankful
Have a ncie day!
Farzan Q. BS(TeleCommunication) Iqra University.
|
|
Reply By:
|
happygv
|
Reply Date:
|
11/15/2004 12:07:35 AM
|
Hi Farzan,
You can search here on this forum for "Paging recordset" this was discussed many times here. That should help you in this.
Cheers!
_________________________ - Vijay G Strive for Perfection
|