<table style="width:100px;background-color:white">
<tr>
<td><span style="width:35%;background-color:#d2e8ff"></span></td>
</tr>
</table>

解决方案 »

  1.   

    呵呵,又是您呀!再问一个
    <table style="width:100px;background-color:white" border="1">
    <tr>
    <td ><span style="width:35%;background-color:#d2e8ff" >35%</span></td>
    </tr>
    </table>
    若要使35%居中该怎么办?
      

  2.   

    <table style="width:100px;background-color:white" border="1">
    <tr>
    <td><div style="width:35%;background-color:#d2e8ff;text-align:center" >35%</div></td>
    </tr>
    </table>
      

  3.   

    <table style="width:100px;background-color:white" border="1">
    <tr>
    <td align=center><div style="width:35%;background-color:#d2e8ff">35%</div></td>
    </tr>
    </table>
      

  4.   

    很笨的做法:
    <table style="width:100px;background-color:white" border="1">
    <tr>
    <td>
    <div  style="width:75%;background-color:#d2e8ff" >&nbsp;</div>
    <span id=p style="position:absolute;">35%</span>
    </td>
    </tr>
    </table>
    <script language="JavaScript">
    <!--
    var e=p.parentElement
    var l=e.offsetLeft;
    var t=e.offsetTop
    while(e=e.offsetParent){
    l+=e.offsetLeft;
    t+=e.offsetTop
    }
    p.style.left=l+(p.parentElement.offsetWidth-p.offsetWidth)/2;
    p.style.top=t+2
    //-->
    </script>
      

  5.   

    牛!加分,立马!!!谢谢!!!我先试试扩展到整个table,呵呵!