Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Tabliczka Mnożenia</title>
- <script type="text/javascript">
- var wiersze = prompt("ile wierszy?");
- var kolumny = prompt("ile kolumn?");
- if(wiersze == " "|| wiersze== null)
- wiersze = 10;
- if(kolumny== " " ||kolumny == null)
- kolumny = 10;
- createTable(wiersze, kolumny);
- function createTable(wiersze, kolumny)
- {
- var j=1;
- var output= "<table border='1' width= '500' cellpadding='5'>";
- for(i=1;i<=wiersze;i++)
- {
- output = output + "<tr>";
- while(j<=kolumny)
- {
- output = output + "<td>"+ i*j + "</td>";
- j=j+i;
- }
- output = output + "</tr>";
- j = 1;
- }
- output = output + "</table>";
- document.write(output);
- }
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement