<table id="tbl">
<tr><td>a</td></tr>
<tr><td>b</td></tr>
<tr><td>c</td></tr>
<tr><td>d</td></tr>
</table><script>
for(t=0;t<3:t++)
tbl.firstChild.insertBefore(tbl.rows(1).cloneNode(true),tbl.rows(2))</script>

解决方案 »

  1.   

    <table id=srctb>
    <tr><td>a</td></tr>
    <tr><td>b</td></tr>
    <tr><td>c</td></tr>
    <tr><td>d</td></tr>
    </table>
    <INPUT TYPE="button" value=test onclick="trClone();">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function trClone(){
    for (var i=0;i<2;i++){
    srctb.childNodes(0).insertBefore(srctb.rows[1].cloneNode(true),srctb.rows[2+i]);
    }
    }
    //-->
    </SCRIPT>
      

  2.   

    能否不用ID只用var e=document.all.tags("table");属性?
      

  3.   

    能否不用ID只用var e=document.all.tags("table");属性?
      

  4.   

    能否不用ID只用var e=document.all.tags("table");属性?
      

  5.   

    <table id="rptid" x:str border=0 cellpadding=0 cellspacing=0 width=949 style='border-collapse:
     collapse;table-layout:fixed;width:714pt'>
     <col width=205 style='mso-width-source:userset;mso-width-alt:6560;width:154pt'>
     <col width=93 span=8 style='mso-width-source:userset;mso-width-alt:2976;
     width:70pt'>
     <tr height=21 style='height:15.75pt'>
      <td height=21 class=xl33 width=205 style='height:15.75pt;width:154pt'>#LOOP=5</td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
     </tr>
     <tr height=27 style='height:20.25pt'>
      <td colspan=9 height=27 class=xl34 style='height:20.25pt'>sdfasfasf</td>
     </tr>
     <tr height=27 style='height:20.25pt'>
      <td height=27 class=xl24 style='height:20.25pt'> </td>
      <td class=xl24> </td>
      <td class=xl24> </td>
      <td class=xl24> </td>
      <td class=xl24> </td>
      <td></td>
      <td colspan=3 class=xl35>日期:<font class=font7>#tdate</font></td>
     </tr>
     <tr height=19 style='height:14.25pt'>
      <td height=19 class=xl25 style='height:14.25pt'>项目名称</td>
      <td class=xl26>昨日余额</td>
      <td class=xl26>当日发生</td>
      <td class=xl26>当日收益</td>
      <td class=xl27>当日余额</td>
      <td class=xl28>上月余额</td>
      <td class=xl26>本月发生</td>
      <td class=xl26>本月收益</td>
      <td class=xl26>本月余额</td>
     </tr>
     <tr height=20 style='height:15.0pt'>
      <td height=20 class=xl29 style='height:15.0pt'>$</td>
      <td class=xl30>$</td>
      <td class=xl30>$</td>
      <td class=xl30>$</td>
      <td class=xl31>$</td>
      <td class=xl32>$</td>
      <td class=xl30>$</td>
      <td class=xl30>$</td>
      <td class=xl30>$</td>
     </tr>
     <tr height=21 style='height:15.75pt'>
      <td height=21 style='height:15.75pt'>制表人:<font class=font7>#opname</font></td>
      <td colspan=5 style='mso-ignore:colspan'></td>
      <td colspan=3 class=xl36>打印时间:<font class=font7>#sysdate</font></td>
     </tr>
     <![if supportMisalignedColumns]>
     <tr height=0 style='display:none'>
      <td width=205 style='width:154pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
      <td width=93 style='width:70pt'></td>
     </tr>
     <![endif]>
    </table>
    <script>
    var e = rptid;
    for(var t=0;t<10;t++)
    e.firstChild.insertBefore(e.rows[1].cloneNode(true),e.rows[2]);
    </script>这个为什么不行呀.
      

  6.   

    e.childNodes(1).insertBefore(e.rows[1].cloneNode(true),e.rows[2]);
      

  7.   

    请问高手,能把所有的对表格操作的对象和方法告诉我. tableid和document.all.tags("td")
      

  8.   

    去MSDN里面找,记住表格是不能利用innerHTML来改写值的,只能插入和删除Cell