This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating-deleting rows in HTML(URGENT)

 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I create or delete the rows of the table when I click the button in HTML
Please let me know
Thanks in advance
Angela
 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<SCRIPT LANGUAGE="JavaScript">
function deleteValues(){
anuja.deleteRow(2)
}
function insertValues(){
anuja.insertRow()
}
</SCRIPT>
<body>
<table id = anuja border="1" width="42%">
<TR BGCOLOR=="#FF0000">
<TD BGCOLOR="#FF0000" width="23%">                    
<b>CONTROLLER</b></td>
<TD BGCOLOR="#FF0000" width="77%" >  <b> MODEL</b></td>
</tr>
<TR>
<TD width="23%">                
7040</td>
<td id = ip_421_value width="77%"><div name="IP-421">IP-421</div></td>
</tr>
<TR>
<TD width="23%">                
7050</td>
<td id = ip_421j width="77%"><div name="IP-421J">IP-421J</div></td>
</tr>
<TR>
<TD width="23%">              
7060</td>
<td id = ip_601 width="77%"><div name="IP-601">IP-601</div></td>
</tr>
</table>
<p><input type="submit" value="Insert" name="B1" OnClick ="insertValues()">
<input type="button" value="Delete" name="B3" OnClick ="deleteValues()"></p>
</body>
</html>
I can able to insert row and delete rows. But in insertrows, I cannot able to add cells
Please let me know
Thanks
Angela
 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I finally solve it! Here is my code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<SCRIPT LANGUAGE="JavaScript">
function deleteValues(){
anuja.deleteRow(2)
}
function insertValues(){
aRow = anuja.insertRow();
aCell1 = aRow.insertCell();
aCell1.innerText = "Hello";
aCell2 = aRow.insertCell();
aCell2.innerText = "Hi";
}
</SCRIPT>
<body>
<table id = "anuja" border="1" width="42%">
<TR BGCOLOR=="#FF0000">
<TD BGCOLOR="#FF0000" width="23%">                    
<b>CONTROLLER</b></td>
<TD BGCOLOR="#FF0000" width="77%" >  <b> MODEL</b></td>
</tr>
<TR>
<TD width="23%">                
7040</td>
<td id = ip_421_value width="77%">IP-421</td>
</tr>
<TR>
<TD width="23%">                
7050</td>
<td id = ip_421j width="77%">IP-421J</td>
</tr>
<TR>
<TD width="23%">              
7060</td>
<td id = ip_601 width="77%">IP-601</td>
</tr>
</table>
<p><input type="submit" value="Insert" name="B1" OnClick ="insertValues()">
<input type="button" value="Delete" name="B3" OnClick ="deleteValues()"></p>
</body>
</html>
Thanks
Angela
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic