0
的問題是重複我想,當它達到4行被轉移到新的生產線
代碼PHP表有問題:
// for :
$tr = 1;
while($row = mysql_fetch_array($post_tv)){
$show[] = $row;
if ($tr == 4){
$tr == 1;
}
$tr++;
$marsosmarty->assign("show",$show);
$marsosmarty->assign("tr",$tr);
}
代碼的HTML智者:
<td width="91"><table width="100" height="100" border="0" cellpadding="1" cellspacing="1" bgcolor="#666666">
<tbody><tr>
{section name=table loop=$show}
{if $tr eq 3} </tr><tr> {/if}
<td bgcolor="#FFFFFF">
<a href="./channel.php?id={$show[table].id}" target="az">
<img src="{$show[table].a_IMG}" alt="{$show[table].a_DESC}" width="100" height="100" border="0" class="link-img" title="{$show[table].a_TITLE}">
</a>
</td>
{/section}
</tr>
問題是什麼?你當前的代碼發生了什麼? – nicky77 2012-01-08 16:20:57
問題在於結果顯示在一行中我希望她在表格中顯示(4行..) – 2012-01-08 16:27:57
您是否可以嘗試在整個循環中輸出$ tr的值,以確保它確實滿足您的$ tr eq 3條件 – nicky77 2012-01-08 16:34:13