Reprinted: http://zhidao.baidu.com/question/255951942.html
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Title > Test </ Title >
< Style Type = "Text/CSS" >
Tr
{
Background : # Ff3 ;
}
TR: Nth-child (2n)
{
Background : #6f9 ;
}
Tr
{
Background-color : Expression (this. sectionrowindex % 2 = 0 )? "# Ff3": "#6f9 ") ;
}
</ Style >
</ Head >
< Body >
< Table >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows</ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
< Tr > < TD > This is an odd number of rows </ TD > </ Tr >
< Tr > < TD > This is an even number of rows </ TD > </ Tr >
</ Table >
</ Body >
</ Html >
Test
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |
This is an odd number of rows |
This is an even number of rows |