Hey,
I was given a task for a class to make a table that shows 1-10 in the first column, the square of 1-10 in the next column and the cube of 1-10 in the last column. Well I got it to work it just looks sloppy to me and how would I add any additional rows without it showing more value?
Thanks
Dean
function squareCube() {
document.write("<table>");
for (rowNum=0; rowNum < 11; rowNum++) {
document.write("<tr>");
for (colNum=1; colNum < 2; colNum++) {
x = Math.pow(rowNum, 2);
y = Math.pow(rowNum, 3);
document.write("<td>"+rowNum+"</td>");
document.write("<td>"+x+"</td>");
document.write("<td>"+y+"</td>");
}
document.write("</tr>");
}
document.write("</table>");
}