smarty模板中用表格来循环读取数据是一件很糟糕的事情,什么地方该加
{section loop=$student_list name=list} {if $smarty.section.list.first || $smarty.section.list.rownum%5==1}<tr>{/if} <td>{$student_list[list].name}</td> {if $smarty.section.list.last == 1 && $smarty.section.list.rownum%5 != 0} <td colspan="{math equation=x-y x=5 y=$smarty.section.list.rownum%5}"> </td> {/if} {if $smarty.section.list.last || $smarty.section.list.rownum%5==0}</tr>{/if} {/section}
注:上例循环的是一个五列的表格
您可能感兴趣的文章
- smarty循环表格并补充表格td不足的情况
- smarty模板中for循环的扩展插件
- smarty模板中使用php函数以及smarty模板中如何对一个变量使用多个函数
- thinkphp模板中判断volist循环的最后一条记录
- smarty模板中给信息添加最新标签
- smarty模板中判断数组为空的方法
- smarty模板中如何生成随机数
- 程序中通过define定义的常量如何在smarty模板中使用

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool