J
judi
Hello,
i have created a table like this. Now I want to create multiple rows
each with two cells using a for loop.
function t(){
var x=document.getElementById('vorschau').insertRow(0);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML="NEW CELL1";
z.innerHTML="NEW CELL2";
x.style.width="100px";
x.style.height="280px";
x.style.border="1px solid black";
x.style.align="top";
}
</script>
</head>
<body onload="t();">
<div id="Seite">
<div id="Inhalt_l">
<table id="vorschau">
</table>
I uncertain how to do. Something like this:
for (var i=0;i<=4;i++){
document.getElementById('vorschau').insertRow(0);
....
}
Would be very happy about an explanation. Another problem is that the
border is not shown and the text is not on the top
(x.style.align="top".
i have created a table like this. Now I want to create multiple rows
each with two cells using a for loop.
function t(){
var x=document.getElementById('vorschau').insertRow(0);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML="NEW CELL1";
z.innerHTML="NEW CELL2";
x.style.width="100px";
x.style.height="280px";
x.style.border="1px solid black";
x.style.align="top";
}
</script>
</head>
<body onload="t();">
<div id="Seite">
<div id="Inhalt_l">
<table id="vorschau">
</table>
I uncertain how to do. Something like this:
for (var i=0;i<=4;i++){
document.getElementById('vorschau').insertRow(0);
....
}
Would be very happy about an explanation. Another problem is that the
border is not shown and the text is not on the top
(x.style.align="top".