hmcka
03-09-2012, 01:54 AM
I think that if there is more space between the columns that it would be easier to read, but whatever I try is not working. Just putting tabs between them is my latest idea, however, the space is not all that big. Is it possible that I have entered it wrong?
Thank you, the code is below:
<html>
<head>
<title>Exercise</title>
<script type = "text/javascript">
<!--
var row = 0;
var cols = 0;
var sum = (row + 1);
if (row ==0)
{
document.write("sum   square   cube");
document.write("<br>");
row++;
}
while((row >= 0) && (row <= 11))
{
document.write(row + "\t" + (row * row) + "\t" + (row * row * row));
document.write("<br>");
row++;
}
// -->
</script>
</head>
<body>
<p>what? seriously, this is working?</p>
</body>
</html>
Thank you, the code is below:
<html>
<head>
<title>Exercise</title>
<script type = "text/javascript">
<!--
var row = 0;
var cols = 0;
var sum = (row + 1);
if (row ==0)
{
document.write("sum   square   cube");
document.write("<br>");
row++;
}
while((row >= 0) && (row <= 11))
{
document.write(row + "\t" + (row * row) + "\t" + (row * row * row));
document.write("<br>");
row++;
}
// -->
</script>
</head>
<body>
<p>what? seriously, this is working?</p>
</body>
</html>