How to add cells dynamically!!
Use insertRow() and The insertCell() method
is used as follows:
insertRow()
var newTR=TableOBJ.insertRow(N);
N represents which row to insert!
Explanation: When N=0, insert to the top row! When N=-1, insert to the end One line, quite omitting this parameter!
insertCell()
var newTD=TrOBJ.insertCell(N);
where N indicates which column to insert into!
Note: When N=0, insert to the top One line! Insert to the last line when N=-1, this parameter is quite omitted!
The following is an example code: