给定table的宽度是250px  高度是200px
如何使图片自适应完全显示在表格中,不管图片的大小。 

解决方案 »

  1.   

    http://blog.csdn.net/musttieying/archive/2006/06/01/767725.aspx看看这里
      

  2.   


    <table border="1" width=50%>
        <tr>
            <td><img src="http://www.google.com/intl/en_ALL/images/logo.gif" style="width:100%" /></td>
        </tr>
    </table>
      

  3.   

    这样啦~ 图片的css中将宽度和高度均设成100%,可以搞定。<table border="1" width="250" height="200">
        <tr>
            <td><img src="http://www.google.com/intl/en_ALL/images/logo.gif" style="width:100%;height:100%" /></td>
        </tr>
    </table>