You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
455 B
JavaScript
15 lines
455 B
JavaScript
5 years ago
|
function createTable()
|
||
|
{
|
||
|
rn = window.prompt("Input number of rows", 1);
|
||
|
cn = window.prompt("Input number of columns",1);
|
||
|
|
||
|
for(var r=0;r<parseInt(rn,10);r++)
|
||
|
{
|
||
|
var x=document.getElementById('myTable').insertRow(r);
|
||
|
for(var c=0;c<parseInt(cn,10);c++)
|
||
|
{
|
||
|
var y= x.insertCell(c);
|
||
|
y.innerHTML="Row-"+r+" Column-"+c;
|
||
|
}
|
||
|
}
|
||
|
}
|