能用.Net中的Table控件完成此功能吗?具体应该怎么做,教教我!(最好能有个例子) 谢了!  

解决方案 »

  1.   

    function Add_onclick() {
    var newrow = Table1.insertRow();
    newrow.insertCell();
    newrow.insertCell();
    newrow.insertCell();
    newrow.insertCell();

    newrow.cells[0].innerHTML = "<TD><INPUT id='productCode' name='productCode' style='BACKGROUND-COLOR:#E0E0E0' size='0' type='hidden' value='' readOnly maxLength='50' onchange='Count_Product_Money()'>"

    +"<INPUT id='productName' name='productName' type='text' style='BACKGROUND-COLOR:#E0E0E0;width:150px'  maxLength='150' value='' readOnly maxLength='200'>"

    +"<INPUT id='btgetproductCode' name='btgetproductCode'type='button' style='width:70px' value='选择产品...' onclick='SelectproductCode()'></TD>";

    newrow.cells[1].innerHTML = "<TD><INPUT id='price' name='price' type='text' style='BACKGROUND-COLOR:#E0E0E0;width:100px' maxLength='100' value='0'  readOnly onchange='Count_Product_Money()'></TD>";

    newrow.cells[2].innerHTML = "<TD><INPUT id='number' name='number' type='text' style='width:100px' maxLength='100' value='0' onchange='Count_Product_Money()' onfocus='getfocus()'></TD>";

    newrow.cells[3].innerHTML = "<TD><INPUT id='money' name='money' type='text' style='BACKGROUND-COLOR:#E0E0E0;width:100px' maxLength='100' readOnly value='0'></TD>";
    }
      

  2.   

    可以。但是建议使用datagrid控件。另,楼上Cell[i]的innerHTML里还包括<td>,</td>,应该不对。
      

  3.   

    用table控件的话,只能在增加了行以后从新读取数据库后填充table.