Update index.html
Browse files- index.html +104 -19
index.html
CHANGED
|
@@ -1,19 +1,104 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Random 3x3 Table</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
display: flex;
|
| 11 |
+
flex-direction: column;
|
| 12 |
+
align-items: center;
|
| 13 |
+
justify-content: center;
|
| 14 |
+
height: 100vh;
|
| 15 |
+
margin: 0;
|
| 16 |
+
background-color: #f5f5f5;
|
| 17 |
+
}
|
| 18 |
+
h1 {
|
| 19 |
+
color: #333;
|
| 20 |
+
margin-bottom: 20px;
|
| 21 |
+
}
|
| 22 |
+
table {
|
| 23 |
+
border-collapse: collapse;
|
| 24 |
+
margin-bottom: 20px;
|
| 25 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 26 |
+
}
|
| 27 |
+
th, td {
|
| 28 |
+
border: 1px solid #ddd;
|
| 29 |
+
padding: 15px;
|
| 30 |
+
text-align: center;
|
| 31 |
+
background-color: white;
|
| 32 |
+
}
|
| 33 |
+
th {
|
| 34 |
+
background-color: #4CAF50;
|
| 35 |
+
color: white;
|
| 36 |
+
}
|
| 37 |
+
button {
|
| 38 |
+
padding: 10px 20px;
|
| 39 |
+
background-color: #4CAF50;
|
| 40 |
+
color: white;
|
| 41 |
+
border: none;
|
| 42 |
+
border-radius: 4px;
|
| 43 |
+
cursor: pointer;
|
| 44 |
+
font-size: 16px;
|
| 45 |
+
transition: background-color 0.3s;
|
| 46 |
+
}
|
| 47 |
+
button:hover {
|
| 48 |
+
background-color: #45a049;
|
| 49 |
+
}
|
| 50 |
+
</style>
|
| 51 |
+
</head>
|
| 52 |
+
<body>
|
| 53 |
+
<h1>Random 3x3 Table</h1>
|
| 54 |
+
<table id="randomTable">
|
| 55 |
+
<thead>
|
| 56 |
+
<tr>
|
| 57 |
+
<th>Column 1</th>
|
| 58 |
+
<th>Column 2</th>
|
| 59 |
+
<th>Column 3</th>
|
| 60 |
+
</tr>
|
| 61 |
+
</thead>
|
| 62 |
+
<tbody>
|
| 63 |
+
<tr>
|
| 64 |
+
<td id="cell-0-0"></td>
|
| 65 |
+
<td id="cell-0-1"></td>
|
| 66 |
+
<td id="cell-0-2"></td>
|
| 67 |
+
</tr>
|
| 68 |
+
<tr>
|
| 69 |
+
<td id="cell-1-0"></td>
|
| 70 |
+
<td id="cell-1-1"></td>
|
| 71 |
+
<td id="cell-1-2"></td>
|
| 72 |
+
</tr>
|
| 73 |
+
<tr>
|
| 74 |
+
<td id="cell-2-0"></td>
|
| 75 |
+
<td id="cell-2-1"></td>
|
| 76 |
+
<td id="cell-2-2"></td>
|
| 77 |
+
</tr>
|
| 78 |
+
</tbody>
|
| 79 |
+
</table>
|
| 80 |
+
|
| 81 |
+
<button onclick="generateRandomTable()">Generate New Random Table</button>
|
| 82 |
+
|
| 83 |
+
<script>
|
| 84 |
+
// Function to generate a random number between min and max (inclusive)
|
| 85 |
+
function getRandomNumber(min, max) {
|
| 86 |
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
// Function to fill the table with random numbers
|
| 90 |
+
function generateRandomTable() {
|
| 91 |
+
for (let i = 0; i < 3; i++) {
|
| 92 |
+
for (let j = 0; j < 3; j++) {
|
| 93 |
+
const cellId = `cell-${i}-${j}`;
|
| 94 |
+
const randomValue = getRandomNumber(1, 100);
|
| 95 |
+
document.getElementById(cellId).textContent = randomValue;
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
// Generate the random table when the page loads
|
| 101 |
+
window.onload = generateRandomTable;
|
| 102 |
+
</script>
|
| 103 |
+
</body>
|
| 104 |
+
</html>
|