Developer forum

Forum » Templates » Loops move next

Loops move next


Reply

Hi there,




 




Now, I want to do some layout of the content of a loop.




I want three records on one line, before I switch to the next ..


So I wonder is there an fuctionality like the asp move.next in a loop I imagine some thing like this:


 


(tags here are bogus)




 


loop start tag


 


record tag


  move.next


record tag


 move.next


record tag

 


loop end tag 


 


Can I do something like this, and if (hopfully) yes, then HOW? 


 


/ Ditte (using Lars' login as mine does not work)


Replies

 
Reply

Let me see if I get this right ...


 


If you have 9 elementes in a loop you want to display them as 3 by 3 ?


Lets say that it's 9 elements in  an unordered list. (UL LI)


 


If this is the case all you need is CSS.


 


Lets say that you have a contentarea of 300px then you can set the with of each element to 300px and float them to the left.


 


CSS example:


ul {


   margin: 0px;


   padding: 0px;


}


 


ul li {


   margin: 0px;


   padding: 0px;


   list-style: none;


   display: block: /* enables you to define height and width even thoug you float the element */


   width: 300px;


   height: 150px;


   float: left; /* floats the li elements from left to right */


   border: 1px solid #000;


}


 


If you do it like this, it's the width of the element that decides the number in each row.


 


// Sebastian

 
Reply

Thanks



but that was the solution I had already come up with


http://lindrisoer.net.dynamicweb.dk/Default.aspx?ID=1



I need the line to go to the other side of the main field:.


in asp you can do like this:


 


do loop


 one record


move.next


 another record


move.next


 yet another record


 


loop



This would loop the records three at the time ..


Now can I do something similar in DW?



Merry X-mas BTW



/ ditte



--------------------------------------


Dammark wrote:



Let me see if I get this right ...




 




If you have 9 elementes in a loop you want to display them as 3 by 3 ?




Lets say that it's 9 elements in  an unordered list. (UL LI)




 




If this is the case all you need is CSS.




 




Lets say that you have a contentarea of 300px then you can set the with of each element to 300px and float them to the left.




 




CSS example:




ul {




   margin: 0px;




   padding: 0px;




}




 




ul li {




   margin: 0px;




   padding: 0px;




   list-style: none;




   display: block: /* enables you to define height and width even thoug you float the element */




   width: 300px;




   height: 150px;




   float: left; /* floats the li elements from left to right */




   border: 1px solid #000;




}




 




If you do it like this, it's the width of the element that decides the number in each row.




 




// Sebastian



 

You must be logged in to post in the forum