https://www.jianshu.com/p/8267a3f32529
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset = "UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>index模块index控制器index操作对应模板</p>
<table border="1" cellspacing="0" cellpadding="2" width="40%">
<caption style="font-size:22px;font-weight:bold">员工信息表</caption>
<tr style="background-color:#83daf1">
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>工资</th>
</tr>
<!-- volist循环 -->
{volist name="user" id="vo" key='k' offset="2" length="5" empty="没有数据"}
<tr>
<td>{$k}</td>
<td>{$vo.name}</td>
<td>{$vo.sex}</td>
<td>{$vo.age}</td>
<td>{$vo.salary}</td>
</tr>
{/volist}
</table>
</body>
</html>
<!-- foreach循环 -->
{foreach name="user" item="value"}
<tr>
<td>{$key}</td>
<td>{$value.name}</td>
<td>{$value.sex}</td>
<td>{$value.age}</td>
<td>{$value.salary}</td>
</tr>
{/foreach}
<!-- for循环 -->
{for start='0' end='10' comparsion='lt' name='i' step='1'}
<tr>
{for start='0' end='5' comparsion='lt' name='j' step='1'}
<td>{$j*5+$i}</td>
{/for}
</tr>
{/for}
来源于:https://www.jianshu.com/p/8267a3f32529