当前位置:编程学习 > C#/ASP.NET >>

怎样动态添加<table>中的表格内容

如题,怎样才能无刷新的状态下,在添加下边一样的表中的<tr><td>的表单呢!
各位辛苦大家了,我想要的表单是下边的<table>中的表生成。



<table border="1" cellpadding="0" cellspacing="0" width="100%"  >       
    <tr>       
              <td width="18%" align="center" colspan="2"  ><b>PROJECT RECORD</b></td>                                  
              <td width="12%" align="center"   colspan="2"><b>DISC</b></td>                                  
              <td width="76%" align="center" colspan="9" ><b>MANHOURS</b></td>   
  <td></td>       
            </tr>          
            <tr>       
              <td width="9%" align="center" rowspan="2"><p align="center"><b>Project Number</b></td>                  
              <td width="8%" align="center" rowspan="2"><p align="center"><b>Client</b></td>                   
              <td width="9%" align="center" rowspan="2" colspan="2"> </td>          
              <td width="6%" align="center" ><b>SAT</b></td>          
              <td width="6%" align="center" ><b>SUN</b></td>          
              <td width="6%" align="center" ><b>MON</b></td>          
              <td width="6%" align="center" ><b>TUE</b></td>          
              <td width="6%" align="center" ><b>WED</b></td>          
              <td width="6%" align="center" ><b>THR</b></td>          
              <td width="6%" align="center"><b>FRI</b></td>          
              <td width="20%" align="center" ><b>REG HOURS</b></td>          
              <td width="12%" align="center"  rowspan="2"><b>APPROVAL</b></td>  
  <td rowspan="2"><b>ADD</b></td>        
            </tr>          
            <tr>          
              
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="6%" align="center" ><b>OT</b></td>  
              <td width="20%" align="center" ><b>OT HOURS</b></td>   
            </tr>  

            <tr>  
              <td width="9%"  rowspan="2">
  <input type="text" name="ProjectNo_<%=i%>"  id="ProjectNo_<%=i%>" value="<%=rsData("ProjectNo")%>" <%=sReadOnly%> index=<%=i%>    size="9"  style="border-style: solid; border-width: 0">
 </td>  
              <td width="8%" align="center" rowspan="2"><span id="Client_<%=i%>"  ><%=rsData("Client")%></span></td>  
           
           <td width="9%" align="center" rowspan="2" valign="middle" colspan="2"><div  id="ctr_show2_<%=i%>" style="display:">
    <input type="text" id="Txt_<%=i%>"   readonly value="<%=rsData("Profession")%>"   name="Txt_<%=i%>"  index=<%=i%>   size="16"><input type="button" name="T_<%=i%>"    value="..." disabled  > <input type="hidden" name='gid_<%=i%>' id='gid_<%=i%>' value="0">
</div></td>
              <td width="6%" align="center"><input type="text" name="SAT1_<%=i%>" id="SAT1_<%=i%>" index=<%=i%> value="<%=rsData("Sat1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="SUN1_<%=i%>" id="SUN1_<%=i%>" index=<%=i%> value="<%=rsData("Sun1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="MON1_<%=i%>" id="MON1_<%=i%>" index=<%=i%> value="<%=rsData("Mon1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="TUE1_<%=i%>" id="TUE1_<%=i%>" index=<%=i%> value="<%=rsData("Tue1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="WED1_<%=i%>" id="WED1_<%=i%>" index=<%=i%> value="<%=rsData("Wed1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="THR1_<%=i%>" id="THR1_<%=i%>" index=<%=i%> value="<%=rsData("Thr1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="FRI1_<%=i%>" id="FRI1_<%=i%>" index=<%=i%> value="<%=rsData("Fri1")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(1)" size="4" style="border-style: solid; border-width: 0"></td>  
              <td width="20%" align="center"><input type="text" id=RegHours_<%=i%> name=RegHours_<%=i%> size="4" readonly value="<%=rsData("Total1")%>" style="border-style: solid; border-width: 0"></td>  
              <td width="12%" align="center" rowspan="2"><%ProjectManagerList "APPROVAL_"&i,rsData("SubmitApproval"),"UserName" %>  
               <td align="center" rowspan="2"><input type="button" name="add" value="ADD"></td>
            </tr>  
            <tr>  
              <td width="6%" align="center"><input type="text" name="SAT2_<%=i%>" id="SAT2_<%=i%>" index=<%=i%> value="<%=rsData("Sat2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="SUN2_<%=i%>" id="SUN2_<%=i%>" index=<%=i%> value="<%=rsData("Sun2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="MON2_<%=i%>" id="MON2_<%=i%>" index=<%=i%> value="<%=rsData("Mon2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="TUE2_<%=i%>" id="TUE2_<%=i%>" index=<%=i%> value="<%=rsData("Tue2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="WED2_<%=i%>" id="WED2_<%=i%>" index=<%=i%> value="<%=rsData("Wed2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="THR2_<%=i%>" id="THR2_<%=i%>" index=<%=i%> value="<%=rsData("Thr2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="6%" align="center"><input type="text" name="FRI2_<%=i%>" id="FRI2_<%=i%>" index=<%=i%> value="<%=rsData("Fri2")%>" <%=sReadOnly%> onfocus="ProjNoCheck()" onblur="workhourChange(2)" size="4" style="color: #FF0000; border-style: solid; border-width: 0"></td>  
              <td width="20%" align="center"><input type="text" id=OtHours_<%=i%> name=OtHours_<%=i%> size="4" readonly value="<%=rsData("Total2")%>" style="border-style: solid; border-width: 0"></td>                
            </tr>  
</table> --------------------编程问答-------------------- javascript的inserRow()
http://www.webjx.com/htmldata/2006-06-23/1151020408.html --------------------编程问答-------------------- 顶
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,