Solved

repeat region

Posted on 2003-11-10
9
424 Views
Last Modified: 2010-04-25
I've designed my webpage with the following layout:

product 1    Product 2


How can I setup a repeat region so that both products are next to each other? everytime I try I end up with:

Product 1   Product
Product 2   Product
Product 3   Product
Product 4   Product

I need something like:

Product 1   Product 2
Product 3   Product 4
Product 5   Product 6
Product 7   Product 8


is this possible?? :(



0
Comment
Question by:stuayre
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 1

Expert Comment

by:gabss
ID: 9722381
hi,

a fast way i can think of is to do 2 seperate tables with 2 seperate recordsets..

this is a Fast way .....

odd in one Recordset evens in the other....

will be better ways but this would be a quick fix and not to complex...

G





0
 
LVL 23

Accepted Solution

by:
adilkhan earned 130 total points
ID: 9723469
gabss I have to disagree with you, you are saying double the Page Load time and resources. if you want it to act as a quick fix maybe it will for you.

any experience with asp?
if yes then you can use the MOD operator

set up a variable before the LOOP

j = 1

then in the LOOP do this

if j MOD 2 = 1 then
"</td><td>"
j = j+1
next

so, we defined a variable and then we increasing the value of that variable everytime it loops through the records, MOd function will take care of the MATH, if j is divided by 2 then Close the Table Cell and OPEN the new CELL, so you might have to play with HTML a little but.

Let me know if you ned help.



0
 
LVL 1

Expert Comment

by:gabss
ID: 9723525
hay adilkhan

quick fix only as stated.....


I am asumming use of DW dialog boxes and Auto record sets....
Not just ASP only.....

Sorry if this put u off stuayre

leave in hands adilkhan

G
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9723658
I agree with you gabss, we are dealing with DW, But sometimes we can not do everything and count on Editiors:). I am sure you had that experience as well.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:jaysolomon
ID: 9728311
is this what you need

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.odd{
      border-right: 1px solid black;
      padding-right: 6px;
}
.even{
      padding-left: 5px;
}
div{
      border: 1px solid black;
      width: 200px;
      text-align: center;
}
-->
</style>
</head>
<body>
<div>
<span class="odd">Product 1</span>
      <span class="even">Product 2</span><br />
<span class="odd">Product 3</span>
      <span class="even">Product 4</span><br />
<span class="odd">Product 5</span>
      <span class="even">Product 6</span><br />
<span class="odd">Product 7</span>
      <span class="even">Product 8</span>
</div>
</body>
</html>
0
 
LVL 23

Expert Comment

by:adilkhan
ID: 9732332
jAy I believe we are dealing with data Handling here not Client Side, maybe we all got it wrong:)
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9732349
hmm

Never seen anything about it in the Q.

*shaking head*
   *i am so confused*
0
 
LVL 1

Author Comment

by:stuayre
ID: 9834418
thanks adilkhan that worked a treat :)

0
 
LVL 2

Expert Comment

by:danalmar
ID: 10019519
hi,
try this, suppose that you have a recordset RS from your database;
first you define your looper:
***********************************************
<%
Dim HLooper1__numRows
HLooper1__numRows = -2
Dim HLooper1__index
HLooper1__index = 0
RS_numRows = RS_numRows + HLooper1__numRows
%>
***********************************************
and now you just put your table with the recordset fields:
***********************************************
<table>
  <%
startrw = 0
endrw = HLooper1__index
numberColumns = 2
numrows = -1
while((numrows <> 0) AND (Not RS.EOF))
      startrw = endrw + 1
      endrw = endrw + numberColumns
 %>
  <tr align="center" valign="top">
    <%
While ((startrw <= endrw) AND (Not RS.EOF))
%>
    <td> <%=(RS.Fields.Item("Product").Value)%> </td>
    <%
      startrw = startrw + 1
      RS.MoveNext()
      Wend
      %>
  </tr>
  <%
 numrows=numrows-1
 Wend
 %>
</table>
***********************************************
if you want more simple, try to get the Horizontal Looper Extensions for DW from MM website

hope helpe you,
dan
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Update 2 tables at the same time 3 463
Download all files with one click 7 593
thumbnails in content 11 292
unable to connect to host / dreamweaver cs3 11 150
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now