一个完整的表格样式
2008-04-24 10:51 | Filed Under Html/JS/CSS |
一坨针对IE的HACK
- table.default {
- background: #C1DCF7 none repeat scroll 0%;
- border: 1px solid #C1DCF7;
- color: #000000;
- width: 98%;
- border-collapse: collapse;
- margin: 0 auto;
- }
- table.default caption {
- background:transparent url(http://blog.sunshow.net/wp-content/uploads/2008/04/bg_list.gif) repeat-x scroll 0%;
- height: 30px !important;
- line-height: 30px;
- text-align: left;
- padding-left: 10px;
- font-size: 14px;
- font-weight: bold;
- color: #FFFFFF;
- }
- table.default caption a:link, table.default caption a:visited {
- color: #000000;
- font-size: 12px;
- text-decoration: underline;
- }
- table.default caption a:hover {
- font-size: 12px;
- color: #14568A;
- }
- table.default thead tr {
- background: #C1DCF7 none repeat scroll 0%;
- color: #000000;
- height: 25px;
- line-height: 25px;
- text-align: center;
- font-size: 13px;
- }
- table.default thead tr th {
- border-color: #C1DCF7; /* fix for IE */
- }
- table.default tbody {
- background: #FFFFFF none repeat scroll 0%;
- text-align: left;
- }
- table.default tbody tr {
- height: 25px;
- line-height: 25px;
- event: expression(
- (this.onmouseover = function() {this.className += ' over';}) &&
- (this.onmouseout = function() {this.className = this.className.replace(' over', '');})
- );
- }
- table.default tbody tr:hover, table.default tbody tr.over {
- background-color: #E8F0FF;
- }
- table.default tbody tr td {
- font-size: 12px;
- padding: 0 0 0 5px;
- border-color: #C1DCF7; /* fix for IE */
- }
- table.default tbody tr td { /* fix for IE when align="center" or align="right" */
- padding-left: expression(
- (((this.align == 'center') || (this.align == 'right')) ? '0px' : '5px')
- );
- padding-right: expression(
- ((this.align == 'right') ? '5px' : '0px')
- );
- }
- table.default tbody tr td[align="center"] {
- padding: 0;
- }
- table.default tbody tr td[align="right"] {
- padding: 0 5px 0 0;
- }
效果展示:
提示:您可以先修改部分代码再运行
相关日志 随机文章
Comments
One Response to “一个完整的表格样式”
Leave a Reply


IE really sucks
[Reply]