-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
127 lines (109 loc) · 3.25 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multiplication Table</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(to right, #2c3e50, #4ca1af);
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}
.tag {
position: absolute;
top: 10px;
left: 10px;
background: red;
padding: 5px 10px;
border-radius: 5px;
font-size: 0.9em;
color: #ecf0f1;
}
h2 {
font-size: 2.5em;
margin-bottom: 20px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
input, button {
padding: 10px 20px;
margin: 10px 5px;
border-radius: 5px;
border: none;
outline: none;
font-size: 1.2em;
}
input {
width: 250px;
}
button {
background-color: #e67e22;
color: #fff;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
box-shadow: 0 4px 8px rgba(230, 126, 34, 0.6);
}
button:hover {
background-color: #d35400;
transform: translateY(-2px);
}
#table {
margin-top: 20px;
text-align: center;
width: 80%;
max-width: 600px;
background: rgba(0, 0, 0, 0.5);
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
#table h3 {
margin-bottom: 20px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
#table div {
padding: 10px;
margin: 5px 0;
background: rgba(255, 255, 255, 0.1);
border-radius: 5px;
transition: background 0.3s ease;
box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}
#table div:hover {
background: rgba(255, 255, 255, 0.2);
}
</style>
</head>
<body>
<div class="tag">Maryam Zohra</div>
<h2>Multiplication Table</h2>
<input type="number" id="number" placeholder="Enter a number">
<button onclick="generateTable()">Generate Table</button>
<div id="table"></div>
<script>
function generateTable() {
const num = document.getElementById('number').value;
const tableDiv = document.getElementById('table');
tableDiv.innerHTML = '';
if (num) {
const table = document.createElement('div');
table.innerHTML = `<h3>Table of ${num}</h3>`;
for (let i = 1; i <= 10; i++) {
const row = document.createElement('div');
row.textContent = `${num} x ${i} = ${num * i}`;
table.appendChild(row);
}
tableDiv.appendChild(table);
} else {
alert('Please enter a number');
}
}
</script>
</body>
</html>