Table alternating color CSS expression_css/html

Source: Internet
Author: User
The first behavior of the other colors, so write this expression
<ptml><pead><meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "><title> table CSS Test </title><style type=" Text/css "><!--tr {background-color: Expression (this.sectionrowindex==0? ") #AFAFAF ":((this.sectionrowindex%2==0)? "#FFF0F0": "#F0F0FF"));} --></style></pead><body bgcolor= "#FFFFFF" leftmargin= "0" topmargin= "0" ><table cellspacing= "1" > <tr> <td> form Test </td> <td> form test </td> <td> form Test </td> <td> table Test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test </td& Gt <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> &LT;TD > Form Test </td> </tr> <tr> <td> form test </td> <td> form test </td> <td> form Test &L T;/td> <td> Forms Testing </td> <td> forms Testing </td> <td> forms Testing </td> </tr> <tr> <td> form test </td> <td> form test </td> <td> form Test </td> <td&gt Table Test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test </ td> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> <td> form Test </td> </tr> <tr> <td> form test </td> <td> form Test </td> &LT;TD > Form Test </td> <td> form test </td> <td> form test </td> <td> form Test </td> </tr>&lt ;/table><p> </p><table cellspacing= "1" > <tr> <td width= "" "> </td> <td wi dth= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" ; </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "50" &Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> </tr> <tr> <td width=" "> </td> <td width=" > </td& Gt &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td widt h= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> </tr> <tr> <td width=" "> </td> <td width=" > </td& Gt <td Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= > </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </t d> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &L T;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td width= "> </td> </tr> <tr> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" + "> </td> <td wid th= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td&gt ; &LT;TD width= "&G"T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> </tr> <tr> <td width= "> </td> <td width=" "> </td> <td width=" "&G" T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> </tr> <tr> <td width= "> </td> <td width=" "> </td> <td width=" "&G" T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> <tdWidth= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;/TR&G T <tr> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" ["> </td> <td w idth= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;/TR&G T <tr> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td widt h= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD width= > </td> <td width= "+" > </td> <td width= "" "> </td> </tr> <tr& Gt &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td widt h= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD Width= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> <td width= "> </td> <td width=" "> </td> </tr> <tr> <td W idth= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> </tr> <tr> <td W idth= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> </tr> <tr> <td width=" &G " T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD WIdth= > </td> <td width= "" > </td> </tr> <tr> <td width= "> </td&gt" ; &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td widt h= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD width= > </td> <td width= "" > </td> </tr> <tr> <td width= "> </td&" Gt &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> <td widt h= > </td> <td width= "+" > </td> <td width= "" "> </td> <td width=" > " </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" ["> </td> <td w idth= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> <td width= "> </td> </tr> <tr> <td width=" [>] </td> <td w idth= > </td> <td width= "" > </td> <td width= "" "> </td> <td width=" &G " T </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> </tr> <tr> <td width=" [>] </td> <td w Idth= ">"</td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> <td width=" "> </td> <td width=" [] > </td> &LT;TD Width= "> </td> <td width=" "> </td> <td width=" 50 "> </td> <td width= Gt </td> <td width= "> </td> <td width=" "> </td> <td width=" "> </td> &LT;TD width= "> </td> </tr></table><p> </p></body></ptml>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
More than a strong CSS
<ptml><pead><meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "><title> table CSS Test </title><style type=" Text/css "><!--#DataGrid1 TR { Background-color:expression (This.sectionrowindex = = 0?) "#FFCCCC": ((this.sectionrowindex% 2 = = 0)? "#FFF0F0": "#F0F0FF")); Color:expression (This.sectionrowindex = = 0?) "#FFFFFF": ""); Font-weight:expression (This.sectionrowindex = = 0?) "BOLD": ""); Tableselect:expression (This.sectionrowindex = = 0?) "": (onmouseover = function () {This.style.backgroundColor = (This.style.backgroundColor! = "#69cdff" ? "#69cdff": (This.sectionrowindex = = 0?) "#FFCCCC": (this.sectionrowindex% 2 = = 0?) "#FFF0F0": "#F0F0FF"))}, onmouseout = function () {This.style.backgroundColor = (this. Style.backgroundcolor! = "#69cdff"? "#69cdff": (This.sectionrowindex = = 0?) "#FFCCCC": (This.sectionrowindex%2 = = 0? "#FFF0F0": "#F0F0FF")))})} #DataGrid1 td {Background-color:expression (This.cellindex = = 0? (This.parentElement.sectionRowIndex = = 0?) "#FFCCCC": "#DDDDDD"): null)}. findareatable {font-size:12px; color: #333333; text-decoration:none; width:1024px; cursor:hand; Background-color: #FF FFFF; Vertical-align:middle; Text-align:center;} --></style></pead><body bgcolor= "#FFFFFF" leftmargin= "0" topmargin= "0" ><table cellspacing= "1" class= "findareatable" id= "DataGrid1" > <tr> <td> Form Test </td> <td> table Test </td> < td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </t D> <td> Forms Testing </td> <td> forms testing </td> </tr> <tr> <td> form testing </td> & lt;td> form Test &Lt;/td> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td& Gt </tr> <tr> <td> forms test </td> <td> form test </td> <td> form Test </td> &LT;TD&G t; table test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test < /td> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td&gt ; <td> form Test </td> </tr> <tr> <td> form test </td> <td> form Test </td> <td> Form test </td> <td> form test </td> <td> form test </td> <td> form test </td> </tr> <t r> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test </td> <td& gt; form Test &LT;/TD> <td> form Test </td> <td> form test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> forms test </td> <td> form test </td> <td> form Test </td> &LT;TD&G t; table test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test < /td> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td&gt ; <td> form Test </td> </tr> <tr> <td> form test </td> <td> form Test </td> <td> Form test </td> <td> form test </td> <td> form test </td> <td> form test </td> </tr> <t r> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test </td> <td& gt; form Test </td> <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> </ tr> <tr> <td> form test </td> <td> form test </td> <td> form test </td> <td> form measurement Trial </td> <td> form test </td> <td> form Test </td> </tr> <tr> <td> form Test &LT;/TD&G T <td> form test </td> <td> form test </td> <td> form test </td> <td> form Test </td> &LT;TD > Form Testing </td> </tr></table></body></ptml>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
  • Related Article

    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.