list.php:
<?php 
require("config.php");
$result=$db->query("select title from people");
$list=array();
while($rs=$db->fetch_array($result))
{
$list[]=$rs;
}
$smarty->assign("p",$list);
header("Location:list.htm");
?>
list.htm:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><table width="555" border="1">
{section name=list loop=$p}
{if (($smarty.section.list.index+1) mod 4)==1}
<tr>
{/if}
    <td>{$p[list].title}</td>
{if (($smarty.section.list.index+1) mod 4)==0}
</tr>
{/if}
{/section}
</table>
</body>
</html>