0

I am trying to make a table with javascript. It's looking right but don't working. Can anybody help me please?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border=1>
    <script>
        var i,j;
        document.write("<table border=1>");
        for(i=1;1<5;i++){
            document.write("<tr>");
            for(j=1;j<5;j++){

                document.write("<td>"+(i*j)+"</td>");
            }
            document.write("</tr>");
        }
        document.write("</table>");

    </script>
    </table>
</body>
</html>
muratm
  • 3
  • 2
  • This isn't how Stack Overflow works. Read [ask]. – Robert Harvey Jul 03 '21 at 00:13
  • Welcome to stack overflow! Please take the [tour](https://stackoverflow.com/tour) to learn about the rules of the site as well as [how to ask](https://stackoverflow.com/help/how-to-ask) a good question. – Jared Smith Jul 03 '21 at 00:13
  • 1
    Also, don't use `document.write`. [Ever.](https://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice) – Jared Smith Jul 03 '21 at 00:14

1 Answers1

0

In your "for loop" for(i=1;1<5;i++) *1<5 instead of *i<5

yuxufabio
  • 51
  • 5