CSS style settings (the mouse changes the color of the table, controls the color of the table on the line, and adds a CSS file reference)

Source: Internet
Author: User

Hover the mouse over the table color style:
<Style>
Table {background-color: #000000; cursor: hand; width: 100% ;}
TD {
/* Set Onmouseover event */
Onmouseover: expression (onmouseover = function () {This. style. bordercolor = 'Blue '; this. style. color = 'red'; this. style. backgroundcolor = 'yellow '});
/* Set the onmouseout event */
Onmouseout: expression (onmouseout = function () {This. style. bordercolor = ''; this. style. Color =''; this. style. backgroundcolor = ''});
Background-color: # ffffff;
}
</Style>
Controls the color of the table to be separated by rows:
Simple application:
<Style type = "text/CSS">
<! --
Tr {background-color: expression (this. sectionrowindex % 2 = 0 )? "# E1f1f1": "# f0f0f0 ")}
-->
Advanced Application: changing color of each cell
<Style type = "text/CSS">
<! --
Tr {background-color: expression (this. sectionrowindex % 2 = 0 )? "Red": "blue ")}
TD {background-color: expression (this. cellindex % 2 = 0 )? "" :( (This. parentelement. sectionrowindex % 2 = 0 )? "Green": "yellow "))}
-->
</Style>
Add CSS file reference:
<Link id = "cssstyle" rel = "stylesheet" type = "text/CSS" href = "../style.css"/>

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.