代码驿站移动版
频道导航
HTML/Xhtml
CSS
JavaScript
HTML5
PHP教程
ASP.NET
正则表达式
AJAX
ThinkPHP
Yii
MySQL
MariaDB
Oracle
MongoDB
Redis
DedeCMS
PHPCMS
帝国CMS
WordPress
Discuz
其它CMS
Zend Studio
Sublime
Notepad
Dreamweaver
Windows
Linux
Nginx
Apache
IIS
CentOS
Ubuntu
Debian
网站优化
工具资源
PHP源码
ASP.NET源码
其它源码
图标素材
按钮素材
字体素材
DedeCMS模板
帝国CMS模板
PHPCMS模板
WordPress模板
Discuz!模板
单页模板
开发软件下载
服务器软件下载
广告投放
联系我们
版权申明
软件编程
网页前端
移动开发
数据库
服务器
脚本语言
PHP代码
JAVA代码
Python代码
Android代码
当前位置:
主页
>
网页前端
>
HTML代码
>
表格隔行换色 css expression
时间:2020-10-17 23:29:34 | 栏目:
HTML代码
| 点击:次
第一行为其它颜色,这样写这个表达式
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>表格CSS测试</title><style type="text/css"><!--tr { background-color: expression(this.sectionRowIndex==0?"#AFAFAF":((this.sectionRowIndex%2==0) ? "#FFF0F0" : "#F0F0FF"));}--></style></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"><table cellspacing="1"> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr></table><p> </p><table cellspacing="1"> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr> <tr> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> <td width="50"> </td> </tr></table><p> </p></body></html>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
比较强的css
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>表格CSS测试</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: #FFFFFF; vertical-align: middle; text-align: center;}--></style></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"><table cellspacing="1" class="FindAreaTable" ID="DataGrid1"> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr> <tr> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> <td>表格测试</td> </tr></table></body></html>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
您可能感兴趣的文章:
CSS hack实现 CSS完美兼容IE6/IE7/FF的通用方法
用CSS控制的闪烁效果
css不用图片美化按钮
兼容多浏览器实现半透明(Opera ie firefox)
什么是XHTML?
相关文章
11-12
用CSS给图片打标的代码
10-07
iframe背景透明的设置方法
11-03
怎么改善现有网站
12-03
不要使用CSS Expression的原因分析
11-18
CSS Hack 汇总快查
JQuery
VUE
AngularJS
MSSql
MySQL
MongoDB
Redis
Linux
Tomcat
Nginx
网站首页
广告投放
联系我们
版权申明
联系站长