<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    我思故我強

    動態給表格增加/刪除一行

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>動態給表格增加/刪除一行</title>
    </head>
    <script language=javascript>
    allCount=1
    function addline()
    {
    newRow=listtable.insertRow(listtable.rows.length);
    newRow.ln=allCount;
    newRow.id=allCount;
    c1=newRow.insertCell(0);
    c1.bgColor="#FFFFFF";
    c1.innerHTML="<input size=10 name=sClass"+allCount+">";
    c2=newRow.insertCell(1);
    c2.bgColor="#FFFFFF";
    c2.innerHTML="<input size=10 name=sMaterial"+allCount+">";
    c3=newRow.insertCell(2);
    c3.bgColor="#FFFFFF";
    c3.innerHTML="<input size=10 name=sSpec"+allCount+">";
    c4=newRow.insertCell(3);
    c4.bgColor="#FFFFFF";
    c4.innerHTML="<input size=10 name=sPrice"+allCount+">";
    c5=newRow.insertCell(4);
    c5.bgColor="#FFFFFF";
    c5.innerHTML="<input size=10 name=sAmount"+allCount+">";
    c6=newRow.insertCell(5);
    c6.bgColor="#FFFFFF";
    c6.innerHTML="<input size=10 name=sFactory"+allCount+">";
    c7=newRow.insertCell(6);
    c7.bgColor="#FFFFFF";
    c7.innerHTML="<input size=10 name=sDeliveryPlace"+allCount+">";
    c8=newRow.insertCell(7);
    c8.bgColor="#FFFFFF";
    c8.innerHTML="<input size=10 name=sNotes"+allCount+">";
    c9=newRow.insertCell(8);
    c9.bgColor="#FFFFFF";
    c9.align="CENTER";
    c9.innerHTML="<input type=checkbox value=t checked name=cPub"+allCount+">";
    c10=newRow.insertCell(9);
    c10.bgColor="#FFFFFF";
    c10.align="CENTER";
    c10.id="line"+allCount;
    c10.innerHTML="<input type=button value=刪除 onclick=delline(line"+allCount+")>";
    c11=newRow.insertCell(10);
    c11.bgColor="#FFFFFF";
    c11.align="CENTER";
    c11.innerHTML="<input type=button value=插入 onclick=insertline(line"+allCount+")>";
    allCount++
    }
    function insertline(lineid)
    {
    for(i=0;i<listtable.rows.length;i++)
    {
    if(listtable.rows[i].cells[9].id==lineid.id)
    {
    newRow=listtable.insertRow(i);
    newRow.ln=allCount;
    newRow.id=allCount;
    c1=newRow.insertCell(0);
    c1.bgColor="#FFFFFF";
    c1.innerHTML="<input size=10 name=sClass"+allCount+">";
    c2=newRow.insertCell(1);
    c2.bgColor="#FFFFFF";
    c2.innerHTML="<input size=10 name=sMaterial"+allCount+">";
    c3=newRow.insertCell(2);
    c3.bgColor="#FFFFFF";
    c3.innerHTML="<input size=10 name=sSpec"+allCount+">";
    c4=newRow.insertCell(3);
    c4.bgColor="#FFFFFF";
    c4.innerHTML="<input size=10 name=sPrice"+allCount+">";
    c5=newRow.insertCell(4);
    c5.bgColor="#FFFFFF";
    c5.innerHTML="<input size=10 name=sAmount"+allCount+">";
    c6=newRow.insertCell(5);
    c6.bgColor="#FFFFFF";
    c6.innerHTML="<input size=10 name=sFactory"+allCount+">";
    c7=newRow.insertCell(6);
    c7.bgColor="#FFFFFF";
    c7.innerHTML="<input size=10 name=sDeliveryPlace"+allCount+">";
    c8=newRow.insertCell(7);
    c8.bgColor="#FFFFFF";
    c8.innerHTML="<input size=10 name=sNotes"+allCount+">";
    c9=newRow.insertCell(8);
    c9.bgColor="#FFFFFF";
    c9.align="CENTER";
    c9.innerHTML="<input type=checkbox value=t checked name=cPub"+allCount+">";
    c10=newRow.insertCell(9);
    c10.bgColor="#FFFFFF";
    c10.align="CENTER";
    c10.id="line"+allCount;
    c10.innerHTML="<input type=button value=刪除 onclick=delline(line"+allCount+")>";
    c11=newRow.insertCell(10);
    c11.bgColor="#FFFFFF";
    c11.align="CENTER";
    c11.innerHTML="<input type=button value=插入 onclick=insertline(line"+allCount+")>";
    allCount++
    return;
    }
    }
    }
    function delline(lineid)
    {
    for(i=0;i<listtable.rows.length;i++)
    {
    for(j=0;j<listtable.rows[i].cells.length;j++)
    {
    if(listtable.rows[i].cells[j].id==lineid.id)
    {
    listtable.deleteRow(i);
    return;
    }
    }
    }
    }
    </script>

    <body>
    <table width=700 height="20" border="0" align="center" cellpadding=0 cellspacing=0 id=listtable>
    <tr align=center height=20>
    <td bgcolor=#FFFFFF><b>品名</b></td>
    <td bgcolor=#FFFFFF><b>材質</b></td>
    <td bgcolor=#FFFFFF><b>規格</b></td>
    <td bgcolor=#FFFFFF><b>價格</b></td>
    <td bgcolor=#FFFFFF><b>數量</b></td>
    <td bgcolor=#FFFFFF><b>產地</b></td>
    <td bgcolor=#FFFFFF><b>交貨地</b></td>
    <td bgcolor=#FFFFFF><b>備注</b></td>
    <td bgcolor=#FFFFFF><b>發布</b></td>
    <td bgcolor=#FFFFFF><b>-</b></td>
    <td bgcolor=#FFFFFF><b>-</b></td>
    </tr>
    </table>
    <table width="700" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr><td align="center"><input type=button value=增加一行 onclick=addline()></td>
    </tr>
    </table>
    </body>
    </html>

    posted on 2008-08-11 09:50 李云澤 閱讀(657) 評論(0)  編輯  收藏 所屬分類: javascriptHTML

    主站蜘蛛池模板: 亚洲成a人片在线观看精品| 亚洲国产精品嫩草影院| 日韩在线播放全免费| 亚洲高清一区二区三区电影| 亚洲国产精品第一区二区三区| 久久久久久亚洲精品不卡| 男人进去女人爽免费视频国产| 亚洲一区二区三区久久| 亚洲精品人成无码中文毛片 | 2020久久精品亚洲热综合一本| 免费人成网站在线高清| 一区二区三区在线免费看| 亚洲乱妇老熟女爽到高潮的片| 亚洲愉拍99热成人精品热久久| free哆啪啪免费永久| 日韩成人毛片高清视频免费看| 亚洲色图综合网站| www.亚洲色图.com| 日本最新免费网站| 99免费在线视频| 日韩国产欧美亚洲v片 | 亚洲第一AAAAA片| 国产又大又粗又硬又长免费| 亚欧免费一级毛片| 日本视频免费观看| 亚洲三级在线免费观看| 国产AV无码专区亚洲Av| 亚洲?v无码国产在丝袜线观看| 在线看免费观看AV深夜影院| 久久久久久av无码免费看大片 | 羞羞视频免费网站在线看| 亚洲国产成人AV在线播放| 亚洲一区综合在线播放| 亚洲一级特黄大片无码毛片 | 久久精品国产大片免费观看| 成人免费视频一区二区| 亚洲色大成网站www久久九| 中文字幕亚洲第一在线| 亚洲色WWW成人永久网址| 国产v片免费播放| 一二三四视频在线观看中文版免费|