Finished multi-multiplication table

This commit is contained in:
raul 2024-01-18 11:42:18 +01:00
parent 23adce80cf
commit 67f3590a75
2 changed files with 8 additions and 1 deletions

5
9.html
View File

@ -2,6 +2,11 @@
<head> <head>
<meta name="" charset="UTF-8" content=""> <meta name="" charset="UTF-8" content="">
<style>
* {
text-align: center;
}
</style>
</head> </head>
<body> <body>

4
9.js
View File

@ -1,13 +1,15 @@
function multiplicador(multipl) { function multiplicador(multipl) {
document.write(`<p align=center>`)
for (let i = 1; i < 11; i++) { for (let i = 1; i < 11; i++) {
document.writeln(`${multipl} * ${i} = ${i * multipl}<br>`) document.writeln(`${multipl} * ${i} = ${i * multipl}<br>`)
} }
// Adding horizontal line for visual clarity // Adding horizontal line for visual clarity
document.write(`</p>`)
document.writeln(`<hr>`) document.writeln(`<hr>`)
} }
function main() { function main() {
// Declaring multi to hold the second number // Declaring multi to hold the first number
var multi = 1; var multi = 1;
// For loop that and for every time the multiplier function ends, run multi++ to sum // For loop that and for every time the multiplier function ends, run multi++ to sum