Advertisement
gasaichan

table-generator

Dec 19th, 2019
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8" />
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7.     <title>Document</title>
  8.   </head>
  9.   <body>
  10.     <script>
  11.       document.write('<table border="1">');
  12.       let prod = 1;
  13.       while (prod < 1000) {
  14.        let n = prompt("Введите число для первой ячейки строки");
  15.        prod *= n;
  16.        document.write("<tr>");
  17.         document.write(`<td>${n}</td>`);
  18.         for (let i = 0; i < 3; i++) {
  19.          document.write(`<td>${i + 2}</td>`);
  20.         }
  21.       }
  22.       document.write("</table>");
  23.     </script>
  24.   </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement