如何实现动态增加一行和删除一行。
在录入数据时,如何实现动态增加和删除一行的文本框或下接菜单。然后保存是,是循环保存的。
程序代码:
<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>摘 要</title> </head> <body> <table align="center" border="0" cellspacing="1" width="800"> <tr> <td width="100%"> <p align="center"><font size="5" face="宋体" color="#008000"><b>记 账 凭 证</b></font></td> </tr> <tr> <td width="100%"> <p align="center"><font size="5" face="宋体" color="#008000"><span style="letter-spacing: 4pt">VOUCHER</span></font></td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="33%"></td> <td width="33%"> <hr color="#008080"> </td> <td width="34%"></td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="12%"></td> <td width="12%"></td> <td width="12%"> <p align="right">日期:</td> <td width="25%"></td> <td width="13%"></td> <td width="13%"></td> <td width="13%"> <p align="right"><font color="#008000">第 号</font></p> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="12%"></td> <td width="12%"></td> <td width="12%"></td> <td width="12%"></td> <td width="13%"></td> <td width="13%"></td> <td width="13%"></td> <td width="13%"><font color="#008000">VOUCHER NO.</font></td> </tr> </table> </td> </tr> <tr> <td width="100%" align="center"> <table border="1" cellspacing="0" width="800" cellpadding="0" bordercolorlight="#008080" bordercolordark="#008080" height="220"> <tr> <td width="240" align="center" height="45"> <p align="center" style="line-height: 100%; word-spacing: 0; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>摘 要</b></font> <p align="center" style="line-height: 100%; word-spacing: 0; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>DESCRIPTION</b></font></td> <td width="120" align="center" height="45"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>科目代码</b></font></p> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>GEN.LED.CODE</b></font></td> <td width="200" align="center" height="45"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>科 目 名 称</b></font></p> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>GEN.LED.A/C</b></font></p> </td> <td width="120" align="center" height="45"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>借 方 金 额</b></font></p> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>DEBIT AMT.</b></font></p> </td> <td width="120" align="center" height="45"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>贷 方 金 额</b></font></p> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font color="#008000"><b>CREDIT AMT.</b></font></p> </td> </tr> <tr> <td width="240" height="25" align="left"><b> </b></td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25" align="left"><b></b> </td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25" align="left"><b> </b></td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25" align="left"><b></b> </td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25" align="left"><b></b> </td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25" align="left"><b></b> </td> <td width="120" height="25" align="left"> </td> <td width="200" height="25"><b> </b></td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> <tr> <td width="240" height="25"><font color="#008000"><b> 附单据 张 ATTACHMENTS</b></font></td> <td width="120" height="25" align="left"> <p align="left"> </td> <td width="200" height="25"> <p align="center"><font color="#008000"><b>合 计(TOTAL)</b></font></p> </td> <td width="120" height="25" align="right"> </td> <td width="120" height="25" align="right"> </td> </tr> </table> </td> </tr> <tr> <td width="100%" height="2"> </td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="12%"><font color="#008000">记账:</font></td> <td width="12%"></td> <td width="12%"> <p align="right"><font color="#008000">出纳:</font></td> <td width="12%"></td> <td width="13%"> <p align="right"><font color="#008000">复核:</font></td> <td width="13%"></td> <td width="13%"> <p align="right"><font color="#008000">制单:</font></td> <td width="13%"></td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> <td width="20%"></td> </tr> </table> </td> </tr> </table> <p align="center"> </p> </body> </html>
就如这样的。但保存时,每一行实际上都是在相同的表中。如何区分出,借方金额和贷方金额来