This looks as it should except that it needs more spacing between the columns. How would I do that?
<script type="text/javascript">
/* <![CDATA[ */
var numRows = "10";
var numCols = "10";
if (isNaN(numRows) || isNaN(numCols)) {
}else {
var tblHTML = "", rowHTML;
for (var row = 0; row <= numRows; row++) {
rowHTML = "";
for (var col = 0; col <= numCols; col++) {
if (row == 0) {
rowHTML += "<td>" +
((col == 0) ? " " : col) +
"</td>";
} else if (col == 0) {
rowHTML += "<td>" +
row +
"</td>";
} else {
rowHTML += "<td>" +
(row * col) +
"</td>";
}
}
tblHTML += "<tr>" + rowHTML + "</tr>";
}
document.write("<table border=\"0\">" +
tblHTML +
"</table>");
}
/* ]]> */
</script>
</head>
<body>
</body>
</html>