Vikram: did you even try a simple google search?
<html>
<head>
<script language="javascript">
function AddRow(){
var table = document.getElementById("myTable");
if (!table) throw "Table not found";
var row = table.insertRow(-1); //append at the end
var cell1 = row.insertCell(-1);
var cell2 = row.insertCell(-1);
cell1.innerHTML = '2';
cell2.innerHTML = 'test';
}
</script>
</head>
<body>
<table border="1" id="myTable">
<tr><td>1</td><td>sam</td></tr>
</table>
<input type="button" onClick="AddRow();" value="Add Row">
</body>
</html>
note that the row won't be available in codebehind..even after a postback...
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"vikram" <an*******@discussions.microsoft.com> wrote in message
news:1f****************************@phx.gbl...
How to add row (<tr>) element in html table at runtime
using javascript.