2010-12-12 8 views
2

Dieser Code funktioniert in IE8, Firefox, Chrome etc. ... aber IE7 nicht erkennen, diese Zeile:IE7 THEAD Tag Styling

.defaulttable Thead {border-right: 55px solid # c7c9cf;}

deshalb sehe ich No-Border in ie7. Wie kann ich dieses Problem lösen?

HTML:

<table id="search_table" class="mtm defaulttable"> 
    <thead> 
    <tr class="sortlinks"> 
     <td>Hello 1</td> 
     <td>Hello 2</td> 
    </tr> 
    </thead> 
    <tbody> 
     ........................... 
</table> 

CSS:

.defaulttable {width:100%;border-collapse:collapse;} 
.defaulttable thead td{font-weight:bold;background: url('/static/images/grey_fade_back.png') repeat-x 0 -2px;white-space:nowrap;} 
.defaulttable thead{border-right:55px solid #c7c9cf;} 
.defaulttable tbody td{border-right:1px solid #c7c9cf;} 
.defaulttable td {border-top:1px solid #c7c9cf;border-bottom:1px solid #c7c9cf;border-left:1px solid #c7c9cf;padding:6px 8px 6px;} 
.defaulttable .project_name{background-image:url('/static/images/mini/project.png');background-position:7px 7px;background-repeat:no-repeat;padding-left:30px} 
.defaulttable .user{background-image:url('/static/images/mini/user.png');background-position:7px 7px;background-repeat:no-repeat;padding-left:30px} 
.defaulttable .job_ad_title{background-image:url('/static/images/mini/pin.png');background-position:7px 8px;background-repeat:no-repeat;padding-left:30px} 
.defaulttable .project_category div{}  
.defaulttable .odd{background:#EFEFEF url(/static/images/button-overlay.png) repeat-x scroll 0 0} 
.defaulttable .hover{background:#FEFFAF url(/static/images/button-overlay.png) repeat-x scroll 0 0} 
.defaulttable .selected{background:#99DFA2 url(/static/images/button-overlay.png) repeat-x scroll 0 0} 
.defaulttable .sortlinks a{color:#444} 
.defaulttable tfoot {} 

Antwort

5

Sie können conditional comments verwenden, um gezielt alternative Regeln IE 7 Ziel:

<!--[if IE 7]> 

    <style> 
    /* alternate style rules for IE 7 */ 
    table thead tr th { /* style the `th` not the `thead` */ } 
    </style> 

<![endif]--> 

Es ist erwähnenswert, dass Überschriften Tisch für das th Element ist passender als td (s Es ist buchstäblich eine "Tabellenüberschrift".