Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

repeat region

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
stuayre
Asked:
stuayre
  • 3
  • 2
  • 2
  • +2
1 Solution
 
gabssCommented:
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
 
Saqib KhanSenior DeveloperCommented:
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
 
gabssCommented:
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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
Saqib KhanSenior DeveloperCommented:
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
 
jaysolomonCommented:
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
 
Saqib KhanSenior DeveloperCommented:
jAy I believe we are dealing with data Handling here not Client Side, maybe we all got it wrong:)
0
 
jaysolomonCommented:
hmm

Never seen anything about it in the Q.

*shaking head*
   *i am so confused*
0
 
stuayreAuthor Commented:
thanks adilkhan that worked a treat :)

0
 
danalmarCommented:
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now