Lindsey Gibbs
New member
html/javascript? I am trying to make a table that has six cells already(2X3) using html/javascript, but make it user-defined. I already have the input box where they can put how many cells and a button. When i open it in IE i can type and everything but when i press the button, it does nothing. It also doesnt give any answers. I was wondering if you could tell me where the problem was or another coding that would work.
Here is the original 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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
var counter=1;
function WriteTable()
{
document.write('<table>');
for(var i=0; i<2; i++)
{
document.write('<tr>')
document.write('</tr>')
}
document.write('</table>');
}
</script>
<script type="text/javascript">
function rowRules()
{
document.getElementById('myTable').rules="rows";
}
function colRules()
{
document.getElementById('myTable').rules="cols";
}
function submit()
{
document.getElementById('myTable').rules="submit";
}
</script>
</head>
<body>
<table id='myTable' border="1">
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
</tr>
<tr>
<td>four</td>
<td>five</td>
<td>six</td>
</tr>
</table>
<br />
<form name="form">
<input type="text" onclick="rowRules" value="rows">
<input type="text" onclick="colRules" value="columns">
<input name="Submit" type="Submit" onclick="Submit" value="go">
</form>
</body>
</html>
Here is the original 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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
var counter=1;
function WriteTable()
{
document.write('<table>');
for(var i=0; i<2; i++)
{
document.write('<tr>')
document.write('</tr>')
}
document.write('</table>');
}
</script>
<script type="text/javascript">
function rowRules()
{
document.getElementById('myTable').rules="rows";
}
function colRules()
{
document.getElementById('myTable').rules="cols";
}
function submit()
{
document.getElementById('myTable').rules="submit";
}
</script>
</head>
<body>
<table id='myTable' border="1">
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
</tr>
<tr>
<td>four</td>
<td>five</td>
<td>six</td>
</tr>
</table>
<br />
<form name="form">
<input type="text" onclick="rowRules" value="rows">
<input type="text" onclick="colRules" value="columns">
<input name="Submit" type="Submit" onclick="Submit" value="go">
</form>
</body>
</html>