|
 |
asp_web_howto thread: How Do I make a repeat region that go down a page, in 2 columns
Message #1 by "Lucy Robinson" <lucy@v...> on Thu, 9 Jan 2003 08:52:40
|
|
Hi there
Please could somebody help me with the following problem (I am using
Ultradev and SQL Server 7).
I have created a repeat region in the usual way, and have selected 16
records to be displayed on screen at any one time (with a next and
previous button on the page if there are more than 16 records).
At the moment, my records are displayed down the page. What I need to do
is have the first 8 going down the page, and then the next 8, also going
down the page but in a second column.
e.g.
1 9
2 10
3 11
4 12
5 13
6 14
7 15
8 16
If there are more than 8 records, the next/previous button appear.
Has anyone done this layout before and can help me code it?
Thanks in advance
Lucy
Message #2 by "kosla78" <nkia@i...> on Thu, 9 Jan 2003 11:11:21 +0200
|
|
Hello Lucy,
I have some similar code that might help
The code below constructs a single-row tab with a previous/next arrow when
you have more than four elements to display..Hope this will help
I know it seems like hell but it works just fine,read it and ask anything
Cheers
Kostas
<%
Dim seeSet, k, objRS, i, buttonElement, currow, counterTab, curTab
Dim getSelected, getYearsOfExperience, tmpSelected,getNoAdd
seeSet=int(Request.QueryString("setOfButtons"))
getNoAdd=Request.QueryString("noAdd")
If seeSet="" Then
seeSet=0
End If
If Request("tab")="" then
curTab=seeset+1
else
curTab=Request.QueryString("tab")
end if
If tmpSelected="" Then
tmpSelected=0
End If
if request("tabid")="" then
Tmp_TabID=0
else
Tmp_TabID=int(request("tabid"))
end if
Set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.Open "SELECT * FROM TABS where id > " & Tmp_TabID, maindb
Response.Write("<table border=0 cellspacing=0><tr>")
currow=0
Do While Not objRS.EOF
currow=currow+1
'currow=1 eae seeSet=0
If(currow=seeSet) Then
Response.Write("<td class='backAtTabprevious2'><a
href=tabcontrol2.asp?setOfButtons=" & seeSet-4 & "><img width='53px'
height='39px' border='0' src='photos/new/iconLeft.gif'/></a></td>")
elseif seeset=0 and currow=1 Then
Response.Write("<td class='backAtTabpreviousD2'><img width='53px'
height='39px' border='0' src='photos/new/left_d.gif'/></a></td>")
End If
If (currow>seeset and currow<seeset+5) Then
counterTab=counterTab+1
If int(currow)=int(curtab) Then
Response.Write("<td class='backAtTabActive2'>" & _
"<a href=tabControl2.asp?tab=" & _
currow & "&setOfButtons=" & _
seeSet & ">" & objRS("DESCR") & "</a></td>")
tmpSelected=objRS("SEL_STAT")
Else
Response.Write("<td class='backattabD2'>" & _
"<a href=tabControl2.asp?tab=" & _
currow & "&setOfButtons=" & _
seeSet & ">" & objRS("descr") & "</a></td>")
End If
End If
if currow>(seeset+4) then
Tmp_TabID=objRS("ID")
exit do
end if
objRS.MoveNext
Loop
if currow<seeset+4 then
for i=currow to seeset+3
Response.Write("<td class='backAtTabDe'>" & _
"</td>")
next
end if
If currow=seeSet+counterTab Then
Response.Write("<td class='backAtTabNextD2'><img width='53px' height='39px'
border='0' src='photos/new/right_d.gif'/></td>")
Else
Response.Write("<td class='backAtTabNext2'><a
href=tabcontrol2.asp?setOfButtons=" & seeSet+4 & "><img width='53px'
height='39px' border='0' src='photos/new/iconRight.gif'/></a></td>")
End If
Response.Write("</tr></table>")
objRS.Close
Set objRS=Nothing
%>
----- Original Message -----
From: "Lucy Robinson" <lucy@v...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Thursday, January 09, 2003 8:52 AM
Subject: [asp_web_howto] How Do I make a repeat region that go down a page,
in 2 columns
> Hi there
>
> Please could somebody help me with the following problem (I am using
> Ultradev and SQL Server 7).
>
> I have created a repeat region in the usual way, and have selected 16
> records to be displayed on screen at any one time (with a next and
> previous button on the page if there are more than 16 records).
>
> At the moment, my records are displayed down the page. What I need to do
> is have the first 8 going down the page, and then the next 8, also going
> down the page but in a second column.
>
> e.g.
> 1 9
> 2 10
> 3 11
> 4 12
> 5 13
> 6 14
> 7 15
> 8 16
>
> If there are more than 8 records, the next/previous button appear.
>
> Has anyone done this layout before and can help me code it?
>
> Thanks in advance
>
> Lucy
>
|
|
 |