|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
frjuni Smarty n00b
Joined: 03 Mar 2007 Posts: 0
|
Posted: Sun Mar 04, 2007 4:22 pm Post subject: Problem with foreach |
|
|
Hello
I've got problem with code:
Code: | <tr>
{foreach name=obrazki from=$aImages item=thumb}
<td style="padding-left: 25px;" align="left" valign="top">
<a href="galeria.php?folder={$folder}&image={$thumb}">
<img src="./galeria/{$folder}/thumbs/{$thumb}" />
</a>
</td>
{if $smarty.foreach.obrazki.iteration is div by 4}
</tr>
<br />
<tr>
{/if}
{/foreach}
</tr>
|
Code outputs every <br /> tag (which should be between each </tr> and <tr> tags) tag before the first cell in table (between <tr> which is outside foreach and first <td> in foreach). I tried to use {capture}, but it doesn't work. Please help me.
Kind regards. |
|
Back to top |
|
mankyd Smarty Regular
Joined: 04 May 2006 Posts: 92 Location: Boston MA
|
Posted: Wed Mar 07, 2007 8:08 pm Post subject: |
|
|
I'm not quite sure how to fix the problem you're having except to ask: Why do you want to output <br /> between the <tr>?
<tr> is a block element - a new line will automatically be inserted after you close each one. Putting a <br /> between them is actually non-compliant code, in violation of w3 standards (all html standards - html, xhtml transitional, xhtml strict, etc.)
Simply put: don't do it. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|