|
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 |
RubDec Smarty n00b
Joined: 07 Jan 2004 Posts: 1 Location: Germany
|
Posted: Wed Jan 07, 2004 5:38 pm Post subject: How create a 4*X image Table |
|
|
Hello erverybody,
Can someone post me a code sample for ceate a 4*x table ?
1234
5678
9012
etc.
i can't use the html_table table funktion, because there more than one cell each row.
my try (don't work) cause ervery fifth picture would not displayed
picnummer is 14, result is:
Code: |
1 2 3 4
6 7 8 9
11 12 13 14
<table border="0" cellspacing="0" cellpadding="3">
<tr>
{section name=items loop=$prod_galerie}
{if $prod_galerie[items].piczahl mod 4 != 0}
<td valign="top" width="116">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" ><a href="javascript:gpicv('{$prod_galerie[items].bild_filename}','{$prod_galerie[items].bild_breite}','{$prod_galerie[items].bild_hoehe}')"><img src="{$assetspath}{$prod_galerie[items].bild}" border="0"></a></td>
</tr>
<tr>
<td><img src="{$imagespath}spacer.gif" width="46" height="5"></td>
</tr>
<tr>
<td valign="top" class="fliesstext10pt">{$prod_galerie[items].bild_headline}</td>
</tr>
</table>
</td>
<td width="17">&</td>
{else}
</tr>
<tr>
{/if}
{/section}
</tr>
</table>
|
German: Da ich bemerkt habe, das Hier auch ein paar deutschsprachige User sind, versuch ich mein Problem in nochmal in deutsch auszudrücken.
Bei mir wird ein array mit Bildern und deren Bildunterschrift an das Template übergeben. Jetzt soll eine Tabelle gebaut werden. Hier soll pro Reihe 4 Bilder mit Bildunterschrift angeziegt werden, wobei das Bild in einer Zelle und die Bildunterschrift in eine Zelle sein soll.
Code: |
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>BILD1</td>
<td>BILD2</td>
<td>BILD3</td>
<td>BILD4</td>
</tr>
<tr>
<td>Text1</td>
<td>Text2</td>
<td>Text3</td>
<td>Text4</td>
</tr>
<tr>
<td>BILD5</td>
<td>BILD6</td>
<td>BILD7</td>
<td>BILD8</td>
</tr>
<tr>
<td>Text5</td>
<td>Text6</td>
<td>Text7</td>
<td>Text8</td>
</tr>
</table> |
Leider wird in meinem Smarty-Code jedes fünfte Bild "verschluckt" also nicht angezeigt, weil ja dann in die ELSE Zweig gesprungen wird. (siehe Code oben).
Die Frage ist nun wie ich das verhindern kann.
Bin für jede Hilfe dankbar |
|
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
|