Reset.css is a colgroup overriding background in IE7 / IE6

I have a table in which columns have a different background specified by colgroup. However, in IE6 / 7, it completely ignores the colgroup background and assumes the background value is reset.css for the cell (which is background: transparent). How can I fix this without going into each cell and manually entering a background value?

HTML

<table id="services-table" border="0" cellpadding="0" cellspacing="0" width="100%">
<colgroup>      
 <col class="services-oddcolumn" />         
 <col class="services-evencolumn" />     
</colgroup> 
<tbody>   
  <tr>     
    <td>Column #1, Row #1</td>
    <td>Column #2, Row #1</td>
  </tr>

  <tr>
    <td>Column #1, Row #2</td>
    <td>Column #2, Row #2</td>
   </tr>
</tbody>

RESET (this is above the main CSS file)

html,body, table,tr,th,td {background:transparent;} //it taking this background value for TD and column

CSS

.services-oddcolumn{background-color:#000 !important; width:10%;} 
.services-evencolumn{background-color:#fff !important; width:10%;}

EDIT - In the end there is no “clean” fix, I just had to change the reset.css file, so the table, tr, th, td tags were excluded from the background: transparent property

+3
source share
1 answer

-, <colgroup>, . HTML.

, , , , , , , .

: http://marc.baffl.co.uk/bugs.php "colgroup". , , , . , IE6 IE7 "" .

, , IE6 IE7.

[EDIT] , IE , , <colgroup> IE- IE4.

IE, , <colgroup> <td> .

+4

Source: https://habr.com/ru/post/1783417/


All Articles