Td_PHP tutorial for incomplete cyclic tables in the smarty Template

Source: Internet
Author: User
Tags smarty template
The cycle table in the smarty template is supplemented with incomplete td. It is very bad to use tables in the smarty template to read data cyclically. Where should we add the tr tag and where should we add the tr tag, if you encounter a situation where you need to add the colspan tag to the smarty template and use tables to read data cyclically, it is very bad.Tag, where to addThe label is okay. if you need to add the colspan label, it will really hurt your mind. However, I have already tried to solve this problem. The following is a special record, in case of this situation. Modify the code as needed:

{section loop=$student_list name=list}{if $smarty.section.list.first || $smarty.section.list.rownum%5==1}{/if}{$student_list[list].name}{if $smarty.section.list.last == 1 && $smarty.section.list.rownum%5 != 0} {/if}{if $smarty.section.list.last || $smarty.section.list.rownum%5==0}{/if}{/section}

Note: The previous example loops through a table with five columns.

Articles you may be interested in
  • Smarty loops the table and supplements the table with insufficient td information
  • Extension of the for loop in the smarty Template
  • Use php functions in the smarty template and how to use multiple functions for a variable in the smarty Template
  • The last record of the volist loop in the thinkphp Template
  • Add the latest tag to the information in the smarty Template
  • Method for judging null array in the smarty Template
  • How to generate a random number in the smarty Template
  • How to use constants defined by define in a program in a smarty Template

...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.