Skip to main content
Inspiring
October 27, 2010
Question

Display 4 items in a row using cfloop and divs

  • October 27, 2010
  • 1 reply
  • 477 views

Hi

I have done this quite successfully using tables.

What i have is a catalogue.

It has 12 items in it.

I want to display 4 on a row.

I am using divs

Here is what 1 row looks like in HTML:

<div class="span-18 last">
    <hr /> 
    <div class="span-1"> </div> 
    <div class="span-4">
          A
    </div>   
    <div class="span-4">
         B
    </div>   
    <div class="span-4">
         C
    </div>
    <div class="span-4">
         D
    </div>
       <div class="span-1 last"> </div>
</div>

How do u use CFLOOP and DIVS to show 4 items on a row, then break to the next 4.

Assistance would fantastic.

Regards

Flash

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    October 27, 2010

    Use something like this:

    <cfif index mod 4 eq 0></cfif>

    To know when you need to create the next row.