As I've said before, my teacher doesn't explain anything, and instead gives me links to a website that's supposed to explain it. But the website is as bad as he is at giving notes.
So anyway, here is what I have to do:
"In a html file create the JavaScript code that will create a table that has 3 rows and 6 columns and will put in Cell 1 - Cell 18 in the 18 cells. To be clear, the first cell has Cell 1 in it (notice the space between the letters and the number, the
second cell across will have Cell 2 in it until the final cell in the lower right will have Cell 18 in it. The first cell in row 2 will have Cell 7 in it. Submit your completed file here."
Xuvaze
Member
9 Points
25 Posts
Javascript help?
Feb 27, 2013 03:32 PM|LINK
Sorry for bothering you guys yet again...

As I've said before, my teacher doesn't explain anything, and instead gives me links to a website that's supposed to explain it. But the website is as bad as he is at giving notes.
So anyway, here is what I have to do:
"In a html file create the JavaScript code that will create a table that has 3 rows and 6 columns and will put in Cell 1 - Cell 18 in the 18 cells. To be clear, the first cell has Cell 1 in it (notice the space between the letters and the number, the second cell across will have Cell 2 in it until the final cell in the lower right will have Cell 18 in it. The first cell in row 2 will have Cell 7 in it. Submit your completed file here."
Here is what I've so far:
<html> <head> <title>Hello </title> </head> <body> <script type="text/javascript"> document.write("<table border=3>") for (row=1; row<=3; row++) { document.write("<tr>") for (col=1; col<=6; col++) { document.write("<td>Cell" + " " + col + "</td>") } document.write("</tr>") } document.write("</table>")</script> </body> </html>This is so tedious...! I can not get the cells to count up. The table just repeats "Cell 1, 2, 3, 4, 5, 6," and doesn't count up.
Again, sorry for bothering you guys. And I hope you can help me. =] Any and all help is appreciated!
AidyF
Star
9246 Points
1576 Posts
Re: Javascript help?
Feb 27, 2013 03:37 PM|LINK
<html> <head> <title>Hello </title> </head> <body> <script type="text/javascript"> var c = 1; document.write("<table border=3>") for (row=1; row<=3; row++) { document.write("<tr>") for (col=1; col<=6; col++) { document.write("<td>Cell" + " " + c + "</td>"); c++; } document.write("</tr>") ; } document.write("</table>")</script> </body> </html>Xuvaze
Member
9 Points
25 Posts
Re: Javascript help?
Feb 27, 2013 04:30 PM|LINK
Wowww.... How did I not figure this out?
I thought of it before but I thought it wouldn't work! I never gave it a chance. haha
Thanks so much! :-)