Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Times Table 2</title>
- <style type="text/css">
- body {
- background-color: #1EC3CB;
- }
- body,td,th {
- color: #000000;
- }
- textarea {
- width: 400px; height: 250px;
- resize: none;
- }
- div {
- text-align:center;
- }
- </style>
- </head>
- <body>
- <h2 align="center">Times Table Sample</h2>
- <div><textarea readonly id="msg">
- </textarea>
- </div>
- <script>
- var col = 0, row = 0, str = "", prod = 0;
- for(row = 1; row <= 12; row++) {
- for(col = 1; col <= 12; col++) {
- prod = row * col;
- if(prod < 100) { prod = " " + prod; }
- if(prod < 10) { prod = " " + prod; }
- str += prod + " ";
- }
- str += "\n";
- }
- document.getElementById("msg").innerHTML = str;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement