<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 李云澤 閱讀(652) 評論(0)  編輯  收藏 所屬分類: javascriptHTML

    主站蜘蛛池模板: 丁香婷婷亚洲六月综合色| 亚洲国产日产无码精品| 一级日本高清视频免费观看 | 久久久精品2019免费观看| 亚洲AV无码一区二区乱子伦 | 国产成人精品免费视频大| 亚洲黄色免费在线观看| 67pao强力打造国产免费| 亚洲国产模特在线播放| 嫩草视频在线免费观看| 国产精品亚洲综合| 亚洲精品无码成人AAA片| 无码国产精品一区二区免费式芒果 | 永久黄网站色视频免费观看| 久久久亚洲精华液精华液精华液 | 亚洲av日韩av高潮潮喷无码 | 国产又大又粗又长免费视频| 亚洲av永久无码精品天堂久久| 大地资源在线观看免费高清| 18禁亚洲深夜福利人口| 中文字幕日韩亚洲| 18级成人毛片免费观看| 亚洲高清乱码午夜电影网| 亚洲日韩VA无码中文字幕| 中文字幕乱码免费看电影| 亚洲高清无在码在线电影不卡| 成人免费a级毛片| 免费无码婬片aaa直播表情| 亚洲av无码成人黄网站在线观看| 免费看男女下面日出水来| 色吊丝免费观看网站| 久久精品亚洲中文字幕无码网站 | 亚洲视频在线精品| 日韩在线不卡免费视频一区| 亚洲日韩国产欧美一区二区三区 | 亚洲熟妇av一区二区三区| 182tv免费视视频线路一二三| 亚洲AV永久无码精品放毛片| 亚洲精品高清无码视频| 毛片a级毛片免费播放100| 国产免费无码一区二区|