Diez B. Roggisch schrieb:
> On Thursday 22 October 2009 15:40:23 adam wrote:
>
>> Hello,
>>
>> i have a file controller that lists all the files and folders. If its
>> a folder then a link is show that the user can click and the page
>> reloads showing that folder contents. If a file is found, which is an
>> image, then the image thumbnail is shown.
>>
>> The problem is that the images are shown one after the other down the
>> page. I want to lay them out in a table 4 coulmns wide and how ever
>> many needed down. How can i do this?
>>
>> This is how i am showing the information at present
>>
>> Folders
>> <br />
>> <div py:for="d in dir">
>>
>> <a href="/file/ftp_session_set/${d}">${d}</a>
>> </div>
>> <br />
>>
>> Files
>> <br />
>> <div py:for="f in thumbnail_files">
>> <img src="${thumbnail_files[f]}" alt="${f}" />
>> <a href="${large_files[f]}">view a large image</a>
>> <br />
>> </div>
>>
>
> Untested:
>
> <tr py:for="start in xrange(0, len(thumbnail_files), 4)">
> <td py:for="f in thumbnail_files[start:start+4]">
> <a href="${large_files[f]}">view a large image</a>
> </td>
> <py:if="0 < start - len(thumbnail_files) < 4">
> <td py:for="_ in xrange(start - len(thumbnail_files))"/>
> </py:if>
> </tr>
>
> Diez
>
> >
>
Using CSS is another solution to layout images on a grid.
http://www.alistapart.com/articles/practicalcss/
Marko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---