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
Dynamic keyword
jtable-adding a row dynamically
dynamic jquery statement
ADD ROW - JSP-Servlet
Insertion of multiple row data for billing purpose.
delete row using id
dynamic polymorphism
delete row from a table in hibernate
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
php dynamic array checking
create dynamic array in javascript
dynamic textfields
Dynamic form
add row in grid using dojo
delete multiple row using checkbox
delete multiple row using checkbox
Arraylist from row values
Java: Adding Row in JTable
uitableview manually delete row
dynamic calender
Count Row - JSP-Servlet
Mysql last row
dynamic query
Works only for one row
how to add dynamic data
dynamic web pages in html
static page and dynamic pages?