Skip to content

Instantly share code, notes, and snippets.

@safranck
Created February 23, 2015 01:06
Show Gist options
  • Save safranck/3960f3b5cc03e7a62793 to your computer and use it in GitHub Desktop.
Save safranck/3960f3b5cc03e7a62793 to your computer and use it in GitHub Desktop.
Times Tables in JavaScript using For Loop
//Print out times table up to 10
for (var n=1; n<=10; n++) {
document.write('<div style="float: left; margin: 25px 10px;">')
for (i=1; i<=10; i++) {
document.write(n + ' x ' + i + ' = ' + n*i + '</br>');
}
document.write('</div>')
}
@rahman101
Copy link

loop
How can I create a time table exactly like the attached picture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment