• We just launched and are currently in beta. Join us as we build and grow the community.

How to make Multiplication Table using JavaScript

yeeboi

AI Model Programmer
Y Rep
0
0
0
Rep
0
Y Vouches
0
0
0
Vouches
0
Posts
90
Likes
166
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Multiplication Table

In this tutorial, we are going to create a simple tutorial using JavaScript. This is a short source code in JavaScript to do this program. And it's called a Multiplication Table In JavaScript. This tutorial is suited for the beginners using JavaScript Language. This is a simple program. Hope you can learn from this. You can also check the live demo of this simple tutorial, so you can get an idea and you can try this out, let's start coding.

⚙ Live Demo

JavaScript Source Code

This is the script for the Multiplication Table.

  1. <

    script language=

    "JavaScript"

    >
  2. document.write

    (

    "<center><table border='1px' width='100%' cellspacing='2' cellpadding='2' style='cursor:pointer;'>"

    )

    ;
  3. for

    (

    var

    a =

    1

    ;

    a <

    16

    ;

    a++

    )

    {

  4. document.write

    (

    "<tr>"

    )

    ;
  5. for

    (

    var

    b =

    1

    ;

    b <

    16

    ;

    b++

    )

    {
  6. document.write

    (

    "<td>"
  7. +

    a*

    b +

    "</td>"

    )

    ;
  8. }
  9. document.write

    (

    "</tr>"

    )

    ;
  10. }
  11. document.write

    (

    "</table></center>"

    )

    ;
  12. </

    script>

And, this is the style.
  1. <style type=

    "text/css"

    >
  2. body {
  3. margin

    :

    auto

    ;
  4. width

    :

    700px

    ;
  5. }
  6. table

    {
  7. text-align

    :

    center

    ;
  8. border

    :

    blue

    1px

    solid

    ;
  9. }
  10. tr {
  11. height

    :

    30px

    ;

  12. }
  13. td {
  14. width

    :

    50px

    ;
  15. font-size

    :

    18px

    ;
  16. font-family

    :

    cursive

    ;
  17. padding

    :

    7px

    ;
  18. color

    :

    blue

    ;
  19. }
  20. td:

    hover

    {
  21. width

    :

    50px

    ;
  22. font-size

    :

    18px

    ;
  23. font-family

    :

    cursive

    ;
  24. padding

    :

    7px

    ;
  25. background

    :

    blue

    ;
  26. color

    :

    white

    ;
  27. }
  28. h2 {
  29. text-align

    :

    center

    ;
  30. color

    :

    red

    ;
  31. }
  32. </style>

Output:

If you are looking for the product of 15 x 15. This is the output.

1_68.jpg


If you are looking for the product of 5 x 13. This is the output.

2_37.jpg


⚙ Live Demo

If you are interested in programming, we have an example of programs that may help you even just in small ways.

Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,341

323,350

Top