Solved

repeat region

Posted on 2003-11-10
9
427 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:
Saqib Khan 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 23

Expert Comment

by:Saqib Khan
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
 
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:Saqib Khan
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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