网页table 中的怎么插入 iframe

来源:互联网 发布:计算机有多少端口 编辑:程序博客网 时间:2024/05/20 06:06

如果何能使iframe的大小随着它包含的网页里面的table大小变化而变化?急切!!!

http://www.blue1000.com/AskPro/js/index.html

  • -----------------------------------------------------------------------------------------

    例如,怎样使iframe的高度和宽度  随着table的高度和宽度  改变而改变?如下:  
    Main.htm  
    <html>  
    <body>  
    <div>  
    <iframe    name=mm  src=”detail.htm”  width=”变数”  height=”变数”  </iframe>  
    </div>  
    </body>  
    </html>  
     
    detail.htm  
    <html>  
    <body>  
    <table  width=”变数”  height=”变数”  border=0  bgcolor=red>  
    <tr><td></td></tr>  
    </table>  
    </body>  
    </html>  
    急切,请高手快指点!!!!  
     
    ---------------------------------------------------------------  
     
    main.htm  
     
    <html>  
    <body>  
    <div>  
    <iframe  id=frmDetail  scrolling=no  name=mm  src="detail.htm"  style="width:expression(this.contentWindow.document.all.tblDetail.width);height:expression(this.contentWindow.document.all.tblDetail.height)"></iframe>  
    <button  onclick="with(document.all.frmDetail.contentWindow.document.all.tblDetail){width=offsetWidth+1}">+</button>  
    <button  onclick="with(document.all.frmDetail.contentWindow.document.all.tblDetail){width=offsetWidth-1}">-</button>  
    </div>  
    </body>  
    </html>  
     
    detail.htm  
     
    <html>  
    <body  leftmargin=0  topmargin=0>  
    <table  id=tblDetail  width=100  height=100  border=0  bgcolor=red>  
    <tr><td></td></tr>  
    </table>  
    </body>  
    </html>  
     
    ---------------------------------------------------------------  
     
    稍微变通一下就是啦.  
    main.htm  
     
    <html>  
    <body>  
    <div>  
    <iframe  id=frmDetail  scrolling=no  name=mm  src="tb.htm"  onload="style.width=this.contentWindow.document.all.tblDetail.offsetWidth;style.height=this.contentWindow.document.all.tblDetail.offsetHeight"></iframe>  
    </div>  
    </body>  
    </html>  
     
     
    tb.htm  
    <html>  
    <body  leftmargin=0  topmargin=0>  
    <table  id=tblDetail  width=100  height=100  border=0  bgcolor=red>  
    <tr><td>  
    dddddddddddddddddddddddddddddddddddddddddddddddddddddddd  
    </td></tr>  
    </table>  
    </body>  
    </html>  
     
    ---------------------------------------------------------------  
     
    test.asp  
    <%  
    url=Request.QueryString("url")  
    %>  
    <body  onload="document.all.ifId.style.width=parseInt(ifId.document.getElementsByTagName('table')[0].width)+20">  
    <iframe  name=ifId  id=ifId  src="<%=url%>"></iframe>  
    <br>  
    <a  href=2.asp?url=1.asp>1.asp</a>  
    <br>  
    <a  href=2.asp?url=2.asp>2.asp</a>  
     
    1.asp  
    <table  width=500>  
    <tr><td>  
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  
    </table>  
     
    2.asp  
    <table  width=200>  
    <tr><td>  
    aaaaaaaaa  
    </table>  

    http://www.blue1000.com/AskPro/js/index.html
  • http://www.blueidea.com/tech/web/2009/7012_5.asp
    http://www.blueidea.com/tech/web/index.asp
  • 原创粉丝点击