Hey people of webdeveloper, i am a new at coding, only been programming javascript for 7 weeks, lol
learning at my education campus. So i need some help with this program i am writting, its no way near done, and it is just a simple script using basic knowledge. Atm its just in its very begining
Basically i am trying to make a table creator, lol, somthing simple until i get better, and please go easy on me =]], if you need anymore info, just ask.
Heres the code:
[CODE]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Table Creator v1.0</title>
<script type=”text/javascript” language=”javascript”>
function createtable() {
var rownumber;
var counter;
// counter is declared
counter = 1
rownumber = parseInt(document.creatorform.rows.value);
document.write(“<table>”);
while (counter<rownumber) {
// getting element aka the div tag called divv, lol and changing the info in it
document.getElementById(“divv”).innerHTML='<tr><td>Hello</td></tr>’;
counter++
}
document.write(“</table>”);
}
</script>
<link href=”table_creator.css” rel=”stylesheet” type=”text/css” />
</head>
<body>
<div id=”dynamictableform” align=”center”>
<form name=”creatorform”>
<table width=”350″>
<tr><th colspan=”2″>Table Creator v1.0</th></tr>
<tr><th>Number Of Rows:</th><td><input type=”text” name=”rows” /></td></tr>
<tr><th>Number Of Colums:</th><td><input type=”text” name=”colums” /></td></tr>
<tr><th>Border Size:</th><td><input type=”text” name=”border” /></td></tr>
<tr><th>Table Width:</th><td><input type=”text” name=”width” /></td></tr>
<tr><th>Table Hieght:</th><td><input type=”text” name=”hieght” /></td></tr>
<tr><th>Colour Of Cells:</th><td><input type=”text” name=”cellsc” /></td></tr>
<tr><th>Colour Of Text:</th><td><input type=”text” name=”textc” /></td></tr>
<tr><th>Font Type:</th><td><input type=”text” name=”fontt” /></td></tr>
<tr><th>Font Size:</th><td><input type=”text” name=”fonts” /></td></tr>
<tr><td colspan=”2″ align=”center”><input type=”submit” name=”create” onclick=”createtable()” value=”Create Table” />
<input type=”reset” onclick=”createtable()” value=”Reset” /></td></tr>
</table>
</form>
</div>
<div id=”divv” align=”center”>
<br />
No table has been created at this point of time.
<br />
</div>
</body>
</html>