Smarty is the simplest way to achieve odd-even color change in the list, smarty list odd-even color change_PHP tutorial

WBOY
Release: 2016-07-13 09:48:10
Original
686 people have browsed it

Smarty’s simplest way to achieve parity and even color change in a list, smarty list parity and even color change

This article describes the simplest method in Smarty to implement parity and even color change in a list. Share it with everyone for your reference. The details are as follows:

I recently encountered a problem in the process of changing templates: changing the color of every other row on the list page. I originally wanted to use a program to achieve it, but I found a very convenient method in the smarty template on the Internet. I would like to share it:

{section name=cat loop=$list} 
  <tr bgcolor="{cycle values="#FFFFFF,#CCCCCC"}"> 
   <td>{$list[cat].id}</td>  
  </tr> 
{/section}
Copy after login

I hope this article will be helpful to everyone’s smarty template program design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1024902.htmlTechArticleSmarty is the simplest way to implement list parity and even color change, smarty list parity and even color change This article tells the example of Smarty's simplest implementation of list parity Method of discoloration. Share it with everyone for your reference. Tool...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template