View Single Post
Old 11-16-2008, 12:01 AM   #5 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Okey, so a new problem occured. Not really an error, but a problem.

I got this:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	
	<head>
		
		<title tal:content="title">Your site name here</title>

	</head>
	
	<body>
		
		<span tal:condition="showUploadlink"><a href="upload.php">Upload an image</a></span>
		
		<br /><br />

		<table tal:condition="showImages" cellspacing="5px">
		
			<caption>Images</caption>
			
			<tbody>
			
				<tr>
					<td tal:repeat="image images">
						<img src="${path}/${image/image_path}" />
					</td>
				</tr>
				
			</tbody>
			
		</table>
		
		<div tal:condition="not:showImages">This user has no images</div>
		
	</body>
	
</html>
Problem is that the td:s keep going on forever. If I put an array of images, that is 100 images, it will list 100 images on the same row. If I place the tal:repeat in the tr tag instead, it will list 100 images on 100 rows. So how can I make a repeat that makes a new tr after say.. 6 images?

So that it produces this:
Code:
<tr>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
</tr>
<tr>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
<td>img</td>
</tr>

etc..
Thanks in advance!
__________________
Tanax is offline  
Reply With Quote