本帖最后由 hellokitty1908 于 2013-01-14 14:05:22 编辑

解决方案 »

  1.   

    这个记录条数是不固定的,用户想选择多少就选择多少。另外,这个IFRAME主页面很多子页面同时在用,子页面高度都不同,所以需要自适应。不能写死IFRAME的高度。
      

  2.   

    <iframe src="test.html" id="iframetest" name="iframetest" frameBorder=0 scrolling=no style="width:100%"></iframe>IFRAME是这么定义的。
      

  3.   

    高度自适应问题 有那么麻烦么 
    试试这2个:1.假设子页面的结构是这样的
    <div  style="overflow:hidden">--最外层包含数据的容器
    <div style="float:left">--数据
    <div>
    </div>
    2.子页面设置高度  ,采用 em为单位 或者百分比 ,这样就能够自动变化了。
      

  4.   

    没有跨域的话很简单。。下面这个实例就行
    js实现的非跨域的iframe高度自适应(完美兼容IE,FF,Opera)
      

  5.   


    这个代码是错的啊。报cwincwin未定义,修改之后也没效果。
      

  6.   

    没效果啊。
    子页面代码是这样的。<html >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript" language="javascript"> 
    function radioClick(obj) { 
          var objValue=obj.value;   
      if(objValue=='1') document.getElementById("tableHide").style.display="";
      else  document.getElementById("tableHide").style.display="none";
      bodyOnload();
    } </script>
    <title>无标题文档</title>
    </head>
    <body">
    <input name="ra" type="radio" value="0" checked="checked"  onclick="radioClick(this)"/>
    <input name="ra" type="radio" value="1"  onclick="radioClick(this)" />
    <table width="200" border="1">
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    <br />
    <table width="200" border="1" style="display:none" id="tableHide">
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
       <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr> <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr> <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr> <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr> <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></body>
    </html>
      

  7.   

    function radioClick(obj) {        var objValue=obj.value;             if(objValue=='1') document.getElementById("tableHide").style.display="";       else  document.getElementById("tableHide").style.display="none";       bodyOnload(); }
    多了一个bodyOnload(); 方法。