Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Display 4 items in a row using cfloop and divs

Explorer ,
Oct 27, 2010 Oct 27, 2010

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

435
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 27, 2010 Oct 27, 2010
LATEST

Use something like this:

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

To know when you need to create the next row.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources