12345678910111213141516171819202122232425 |
- <header>
- <h1>Multiply table</h1>
- </header>
- <body>
- <script>
- arr = [];
- for (let i = 1; i <= 5; i++) {
- arr[i] = [];
- for (let j = 1; j <= 5; j++) {
- arr[i][j] = i * j;
- }
- }
- let str = "";
- for (let i = 1; i <= 5; i++) {
- for (let j = 1; j <= 5; j++) {
- val = arr[i][j];
- str += ' ' + val.toString().padStart(2, ' ');
- }
- str += '\n'
- }
- alert(str);
- </script>
- </body>
|