Dynamic row genertion in javascript?

Dynamic row genertion in javascript?

View Answers

September 4, 2009 at 3:50 PM

Hi Friend,

Use the following code:

<script LANGUAGE="JavaScript">
function addRow(tableID){
var table = document.getElementById(tableID);

var rowCount = table.rows.length;
var row = table.insertRow(rowCount);

var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "text";

var cell2 = row.insertCell(1);
var element2 = document.createElement("input");
element2.type = "text";

var cell3 = row.insertCell(2);
var element3 = document.createElement("textarea");
<form name="f1" id="f1">
<input type="button"value="Add" onclick="addRow('datatable')">
<table id="datatable" cellspacing="0" border="1">
<td><input type="text" ></td><td><input type="text"></td><td><textarea rows="1" cols="20"></textarea></td>


Related Tutorials/Questions & Answers:
Dynamic row genertion in javascript? - JSP-Servlet
JavaScript generate dynamic row
Javascripts events
How to write javascripts - JSP-Servlet
How to write javascripts - JSP-Servlet
delete row
dynamic report
dynamic form
insert and delete a row programmatically
didSelectRowAtIndexPath deselect row
jtable insert row swing
dynamic polymorphism
ModuleNotFoundError: No module named 'row'
ModuleNotFoundError: No module named 'row'
Sql row retrieve - SQL
JTable duplicate values in row
jtable-adding a row dynamically
Dynamic keyword
dynamic jquery statement
ADD ROW - JSP-Servlet
Insertion of multiple row data for billing purpose.
delete row using id
delete row from a table in hibernate
dynamic polymorphism
sqlite database delete row
add image in a row of table
add image in a row of table
PHP Dynamic CheckBox
php dynamic array checking
create dynamic array in javascript
php dynamic array checking
dynamic textfields
delete multiple row using checkbox
add row in grid using dojo
delete multiple row using checkbox
Dynamic form
Arraylist from row values
Java: Adding Row in JTable
uitableview manually delete row
dynamic calender
Count Row - JSP-Servlet
Mysql last row
Works only for one row
dynamic query
how to add dynamic data
dynamic web pages in html
static page and dynamic pages?