<?php
$data = array_fill(0,13, "test");$out = array();
while( count( $data ) > 0 )
{
array_push( $out, "<td>" . join( "</td><td>", array_splice($data,0,3) ) . "</td>" );
}
echo "<table border='1'><tr>".join("</tr><tr>", $out )."</tr></table>";
?>
$data = array_fill(0,13, "test");$out = array();
while( count( $data ) > 0 )
{
array_push( $out, "<td>" . join( "</td><td>", array_splice($data,0,3) ) . "</td>" );
}
echo "<table border='1'><tr>".join("</tr><tr>", $out )."</tr></table>";
?>
你好,我想问一下,使用了smarty模板,使用模板在模板页如何实现呢???
{html_table loop=$row cols=3}
类似的有
tr_attr
td_attr
用法见http://smarty.php.net/manual/en/language.function.html.table.php要生成超链接,可以先生成一个超链接的数组。
for($i=0;$i<count($row);$i++)
{
$link = "<a href='#'>".$row[id]."</a>";
}
然后用$link就可以了
{html_table loop=$link cols=3}
有尝聘用JAVA,硬件开发,PHP, 数据库,C++BUILDER版主
详见:http//www.dvpx.com/forum.aspx
有兴趣的朋友加我QQ: 8502928 OR MSN:[email protected]