Smarty newline instance table newline, smarty newline _ PHP Tutorial

Source: Internet
Author: User
Smarty newline instance table newline, smarty newline. Smarty newline instance table newline, smarty newline add keycounttable {foreachitemitemfrom $ itemskeycount} {if $ countisdivby2} tr {if} td {$ item. name} tdtd smarty newline instance table newline, smarty newline

Add key = count to foreach









<{Foreach item = item from = $ items key = count}><{If $ count is p by 2}> <{/If}> <{If ($ count + 1) is p by 2}> <{/If}><{/Foreach}>
<{$ Item. name}> <{$ Item. summary}> <{$ Item. date}>


Put three <{$ item. name}> rows in each row and modify the parameters as much as you like!







<{Foreach item = item from = $ items key = count}> <{If ($ count + 1) is p by 3}> <{/If}><{/Foreach}>
<{$ Item. name}>


Another example is to use cycle to create rows, but only two rows can be created for each row.








<{Foreach item = item from = $ items}> , "}><{/Foreach}>
<{$ Item. name}>
<{Cycle values ="

Http://www.bkjia.com/PHPjc/926155.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/926155.htmlTechArticlesmarty wrap instance table wrap, smarty wrap add key = count table {foreach item = item from = $ items key = count} {if $ count is p by 2} tr {/if} td {$ item. name}/td...

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.