I am trying to loop a table in JavaScript. PLease help!
<html>
<head>
<body bgcolor="#000000" text="#FFFFFF">
<b>Number of columbs:</b><input type="text" name="col" value="Enter a Number"><br>
<b>Number of rows:</b><input type="text" name="row" value="Enter a Number"><br>
<input type=button value="Do the Table" name=button onClick=code.value>
<table border=2>
<script language="JavaScript">
alert(code)
var code=""
for (var i=1;i<='col.value';i++){
code += "<tr>";
for (var j=1;i<='row.value';j++){
code += "<td>" +eval(5*(i-1)+1) + "</td>";
}
code += "</tr>";
}
code += "</table>"
document.write(code)
</script>
</body>
</head>
</html>
Thanx!
Aqua-Soft Forums