Home > Backend Development > PHP Tutorial > Smarty is the simplest way to achieve odd-even color change in the list, smarty list odd-even color change_PHP tutorial

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:48:10
Original
728 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
Latest Issues
smarty turns on caching garbled characters
From 1970-01-01 08:00:00
0
0
0
Why does tp use smarty template? ?
From 1970-01-01 08:00:00
0
0
0
How do you use smarty to integrate laravel5?
From 1970-01-01 08:00:00
0
0
0
Two ways to install smarty
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template