2010-07-19 10 views
0

J'essaye d'aligner du texte sur des cellules de tableau avec un arrière-plan PNG Transparent, j'utilise le filtre: progid: DXImageTransform.Microsoft .AlphaImageLoader() pour résoudre ce problème dans IE6. Mais le texte ne correspond pas au milieu avec le filtre de style:"vertical-align: middle" sur les cellules de tableau ne s'aligne pas au milieu avec AlphaImageLoader dans IE6

CSS:

.fh { 
font-family:SimSun; 
font-size:12px; 
overflow:hidden; 
padding:0 2px 2px; 
text-align:left; 
vertical-align:middle; 
} 

HTML:

<table width="200" border="1" cellpadding="2" class="x-table"> 
<tr> 
<th scope="col">&nbsp;</th> 
</tr> 
<tr style="height: 77px;"> 
<td class="fh" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./shadow-trans.png')">&nbsp;ABCDEFG</td> 
</tr> 
</table> 

Screenshot:

"vertical_align_ie6" http://filer.blogbus.com/4216262/resource_4216262_1279530625v.png

+1

Où il aligner, depuis milieu est la valeur par défaut vertical- aligner? En outre, pourquoi vos propriétés CSS sont-elles écrites avec des majuscules? – cypher

+0

Les propriétés CSS sont écrites avec des majuscules parce que je l'ai copié à partir de l'outil DebugBar, modifié maintenant. – Fisher

Répondre

0

Essayez décalant la hauteur au TD ou à la TABLE.

0

Je trouve que ce problème peut être résolu par insérer un div avec une table à l'origine td:

HTML:

<table cellspacing="0" cellpadding="0" class="x-table" style="position: absolute; width: 289px; left: 0px;"> 
    <colgroup> 
     <col style="width: 72px;"/> 
     <col style="width: 72px;"/> 
     <col style="width: 72px;"/> 
     <col style="width: 72px;"/> 
    </colgroup> 
    <tbody> 
     <tr style="height: 77px;"> 
      <td class="brw1 brss bbw1 bbss blw1 blss btw1 btss" style="border-color: rgb(153, 204, 255); filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./shadow-trans.png', sizingMethod=crop);background-repeat: no-repeat;" id="A1-0" colspan="4"> 
       <div class="fx" style="height: 76px;"> 
        <table> 
         <tbody> 
          <tr> 
           <td class="fh bw" style="height: 76px; width: 288px;">ABCDEFG</td> 
          </tr> 
         </tbody> 
        </table> 
       </div> 
      </td> 
     </tr> 
    </tbody> 
</table> 
+0

si j'ajoute l'attribut sizingMethod = 'scale' ou sizingMethod = 'crop' à AlphaImageLoader, c'est ok. Mais alors, si l'attribut src est égal à quelque chose comme '/ WebReport/ReportServer? Op = attach_image & id = 7e2bb125-5649-4aaf-add2-86147280220c', il a encore un problème !! – Fisher