PHP分类代码问题
{php$CATEGORY=cache_read('category-'.$mid.'.php');}<tablewidth="100%"cellspacing="0"c...
{php $CATEGORY = cache_read('category-'.$mid.'.php');}
<table width="100%" cellspacing="0" cellspacing="0">
{php $child = get_maincat(0, $CATEGORY, 1);}
{loop $child $i $c}
{if $i%4==0}<tr>{/if}
<td valign="top" width="1%" bgcolor="#D7D7D7">
<a href="{$MODULE[$mid][linkurl]}{$c[linkurl]}" target="_blank" class="px15"><strong>{set_style($c[catname], $c[style])}</strong></a>
{if $c[child]}
{php $sub = get_maincat($c[catid], $CATEGORY, 2);}
{loop $sub $j $s}{if $j < 5} <a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank"><strong>{set_style($s[catname], $s[style])}</strong></a>{/if}{/loop}
{/if}
</td>
{if $c[child]}
<td valign="top" width="24%"{if $i%2==1} bgcolor="#FAFCFE"{/if}>
{php $sub = get_maincat($c[catid], $CATEGORY, 1);}
{loop $sub $j $s}
<ul>
<li><a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank" class="px15"><strong>{set_style($s[catname], $s[style])}</strong></a></li>
{if $s[child]}
{php $sub = get_maincat($s[catid], $CATEGORY, 2);}
{loop $sub $k $l}
{if $j < 5} <a href="{$MODULE[$mid][linkurl]}{$l[linkurl]}" target="_blank"><strong>{set_style($l[catname], $l[style])}</strong></a>{/if}
{/loop}
{/if}
{if $s[child]}
{php $sub = get_maincat($s[catid], $CATEGORY, 1);}
{loop $sub $k $l}{if $k < 4}
<li><a href="{$MODULE[$mid][linkurl]}{$l[linkurl]}" target="_blank" class="g">{set_style($l[catname], $l[style])}</a></li>{/if}
{/loop}
{if $l>4}<li><a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank" class="g">更多</a></li>{/if}
{/if}
</ul>
<div class="c_b"></div>
{/loop}
</td>
{/if}
{if $i%4==3}</tr>{/if}
{/loop}
</table>
这个代码怎么才可以让它转为下一行 如图:
怎么才可以让他便的整齐一点 展开
<table width="100%" cellspacing="0" cellspacing="0">
{php $child = get_maincat(0, $CATEGORY, 1);}
{loop $child $i $c}
{if $i%4==0}<tr>{/if}
<td valign="top" width="1%" bgcolor="#D7D7D7">
<a href="{$MODULE[$mid][linkurl]}{$c[linkurl]}" target="_blank" class="px15"><strong>{set_style($c[catname], $c[style])}</strong></a>
{if $c[child]}
{php $sub = get_maincat($c[catid], $CATEGORY, 2);}
{loop $sub $j $s}{if $j < 5} <a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank"><strong>{set_style($s[catname], $s[style])}</strong></a>{/if}{/loop}
{/if}
</td>
{if $c[child]}
<td valign="top" width="24%"{if $i%2==1} bgcolor="#FAFCFE"{/if}>
{php $sub = get_maincat($c[catid], $CATEGORY, 1);}
{loop $sub $j $s}
<ul>
<li><a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank" class="px15"><strong>{set_style($s[catname], $s[style])}</strong></a></li>
{if $s[child]}
{php $sub = get_maincat($s[catid], $CATEGORY, 2);}
{loop $sub $k $l}
{if $j < 5} <a href="{$MODULE[$mid][linkurl]}{$l[linkurl]}" target="_blank"><strong>{set_style($l[catname], $l[style])}</strong></a>{/if}
{/loop}
{/if}
{if $s[child]}
{php $sub = get_maincat($s[catid], $CATEGORY, 1);}
{loop $sub $k $l}{if $k < 4}
<li><a href="{$MODULE[$mid][linkurl]}{$l[linkurl]}" target="_blank" class="g">{set_style($l[catname], $l[style])}</a></li>{/if}
{/loop}
{if $l>4}<li><a href="{$MODULE[$mid][linkurl]}{$s[linkurl]}" target="_blank" class="g">更多</a></li>{/if}
{/if}
</ul>
<div class="c_b"></div>
{/loop}
</td>
{/if}
{if $i%4==3}</tr>{/if}
{/loop}
</table>
这个代码怎么才可以让它转为下一行 如图:
怎么才可以让他便的整齐一点 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询