Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
How can I know when the third multiple is reached in an arbitrarily long list
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason  
View profile  
 More options Feb 13, 5:25 pm
From: Jason <1jason.whatf...@gmail.com>
Date: Mon, 13 Feb 2012 14:25:39 -0800 (PST)
Local: Mon, Feb 13 2012 5:25 pm
Subject: How can I know when the third multiple is reached in an arbitrarily long list

Hi there,

I'm trying to put together a photo album using django client side and I
want to align the photo's 3 in a row. In order to do this I'm putting the
photo's in a table (not ideal I know...) and I was wondering how I can have
a table row with 3 images only? Right now my table just puts a bunch of
photos in a row but I cannot figure out how to start a new row after 3
images have been put in.

Any ideas would be appreciated.

What I've got so far is:

<h1>{{the_adventures.adventure_name}}
<small>{{the_adventures.adventure_date}}<small></h1>
    <table>
        <tr>
        {% for photo in the_adventures.the_photos %}
            <td>
                <img  height="100px" width="100px" src ="/serve/{{
photo.blob_key.key }}">
            </td>
        {% endfor %}
        </tr>
    </table>
<a href =
"/view_album/{{the_adventures.adventure_name}}/{{the_adventures.adventure_d ate}}/{{the_adventures.cursor}}">Next
page</a>

What I want is:

image image image
image image image
image image image

etc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shawn Milochik  
View profile  
 More options Feb 13, 5:28 pm
From: Shawn Milochik <sh...@milochik.com>
Date: Mon, 13 Feb 2012 17:28:06 -0500
Local: Mon, Feb 13 2012 5:28 pm
Subject: Re: How can I know when the third multiple is reached in an arbitrarily long list
You can use the divisibleby template tag in combination with a
forloop.counter (both explained on this page):

https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#divisib...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason  
View profile  
 More options Feb 13, 5:58 pm
From: Jason <1jason.whatf...@gmail.com>
Date: Mon, 13 Feb 2012 14:58:24 -0800 (PST)
Local: Mon, Feb 13 2012 5:58 pm
Subject: Re: How can I know when the third multiple is reached in an arbitrarily long list

Thank you so much Shawn - you saved the day there!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »