aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Creating-deleting rows in HTML(URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Creating-deleting rows in HTML(URGENT)" Watch "Creating-deleting rows in HTML(URGENT)" New topic
Author

Creating-deleting rows in HTML(URGENT)

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
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

Joined: Nov 27, 2000
Posts: 428
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

Joined: Nov 27, 2000
Posts: 428
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
 
subject: Creating-deleting rows in HTML(URGENT)