Advertisement
ambosdavid

timesTables2

Mar 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Times Table 2</title>
  6. <style type="text/css">
  7. body {
  8. background-color: #1EC3CB;
  9. }
  10. body,td,th {
  11. color: #000000;
  12. }
  13. textarea {
  14. width: 400px; height: 250px;
  15. resize: none;
  16. }
  17. div {
  18. text-align:center;
  19. }
  20. </style>
  21. </head>
  22.  
  23. <body>
  24. <h2 align="center">Times Table Sample</h2>
  25. <div><textarea readonly id="msg">
  26. </textarea>
  27. </div>
  28. <script>
  29. var col = 0, row = 0, str = "", prod = 0;
  30. for(row = 1; row <= 12; row++) {
  31. for(col = 1; col <= 12; col++) {
  32. prod = row * col;
  33. if(prod < 100) { prod = " " + prod; }
  34. if(prod < 10) { prod = " " + prod; }
  35. str += prod + " ";
  36. }
  37. str += "\n";
  38. }
  39. document.getElementById("msg").innerHTML = str;
  40. </script>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement