function makeSquareTable(n) { var i; document.writeln("<html><body><table>") for (i=1; i<=n; i++) { var iSquared = i * i; document.write("<tr>"); document.write("<td>" + i + "</td><td>" + iSquared + "</td>"); document.writeln("</tr>"); } document.writeln("</table></body></html>"); }