CSS implementation of the mouse to slide over the table color

Source: Internet
Author: User
Tags expression

The first type: expression

The code is as follows:

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<style type= "Text/css" >
. tablestyle{
Background-color: #CCCCCC; border: #ff0000 solid 2px; Border-collapse:collapse;  Cursor:hand; width:100%;
}
. TableStyle td{border: #ff0000 solid 2px; border-collapse:collapse;
. TableStyle tr{
Onmouseover:expression (Onmouseover=function ()
{
This.style.color= ' Red ';
This.style.backgroundcolor= ' Yellow '
});
Onmouseout:expression (Onmouseout=function ()
{
This.style.col
This.style.backgroundcolor= '
}
);
}
</style>
<title> Untitled Document </title>
<body>
<table class= "TableStyle" width= "0" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<td>11111111111</td>
<td>22222222222</td>
</tr>
<tr>
<td>33333333333</td>
<td>44444444</td>
</tr>
<tr>
<td>55555</td>
<td>66666666</td>
</tr>
<tr>
<td>77777777777</td>
<td>8888888888</td>
</tr>
</table>
</body>

----------------------------

Simple Interlace Color:

<style type="text/css">
<!--
tr {background-color:expression((this.sectionRowIndex%2==0)?"#E1F1F1":"#F0F0F0")}
-->
</style>
<table>
<tr><td>第1行</td><td>第1列</td></tr>
<tr><td>第2行</td><td>第2列</td></tr>
<tr><td>第3行</td><td>第3列</td></tr>
<tr><td>第4行</td><td>第4列</td></tr>
<tr><td>第5行</td><td>第5列</td></tr>
</table>

-------------------------------

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.