Making a Tabler in Javascript

Lord

All Mighty
Joined
Feb 11, 2011
Messages
15,476
Reaction score
10
Points
31
I want to create a tabler for number 2 in html using javasript for a work,
can somebody help me please?

I already did some progresses:
<html>
<body>
<script type="text/javascript">

var i=0;

for(i=0;i<=20;i++)
{
document.write("="+i*2)
document.write("<br/>")
}
</script>
</body>
</html>

However what appears on screen is:
=0
=2
=4
=6
=8
=10
=12
=14
=16
=18
=20
=22
=24
=26
=28
=30
=32
=34
=36
=38
=40

how can i make it appear:
2x0=0
and so on?


Please i really need some help.
 
Try this:

<html>
<body>
<script type="text/javascript">

var i=0;

for(i=0;i<=20;i++)
{
document.write("2*" + i + "=" + (i*2));
document.write("<br>");
}

</script>
</body>
</html>
 
It didn't work but thanks for the help
 
I DiD IT!!!

<html>
<body>
<script type="text/javascript">
for(i=0;i<=20;i++)
{
document.write("2X"+i+"="+(+i*2))
document.write("</br>")
}
</script>
</body>
</html>

You only had one error, you forgot to put + in (+i*2)
But thanks for the help, without you i wouldn't be able to make it.
 

Users who are viewing this thread

Staff online

Latest posts

Forum statistics

Threads
200,589
Messages
21,768,005
Members
45,604
Latest member
Jackburton82
Back
Top
monitoring_string = "afb8e5d7348ab9e99f73cba908f10802"