-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefs.html
103 lines (97 loc) · 3.23 KB
/
defs.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Definitions List</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f9fa;
margin: 40px;
text-align: center;
}
.container {
max-width: 800px;
margin: auto;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
cursor: pointer;
}
th, td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}
th {
background-color: #007bff;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<div class="container">
<h2>SEARS - FAIR Portal</h2>
<table>
<thead>
<tr>
<th>Term</th>
<th>Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td>HTML</td>
<td>HyperText Markup Language, the standard for creating web pages.</td>
</tr>
<tr>
<td>CSS</td>
<td>Cascading Style Sheets, used to style HTML elements.</td>
</tr>
<tr>
<td>JavaScript</td>
<td>A programming language that enables interactive web pages.</td>
</tr>
<tr>
<td>API</td>
<td>Application Programming Interface, a way for applications to communicate.</td>
</tr>
</tbody>
</table>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
const table = document.querySelector("table");
const headers = table.querySelectorAll("th");
const tbody = table.querySelector("tbody");
headers.forEach((header, index) => {
header.addEventListener("click", () => {
const rows = Array.from(tbody.querySelectorAll("tr"));
const ascending = header.dataset.order !== "asc";
rows.sort((rowA, rowB) => {
const cellA = rowA.cells[index].textContent.trim();
const cellB = rowB.cells[index].textContent.trim();
return ascending ? cellA.localeCompare(cellB) : cellB.localeCompare(cellA);
});
rows.forEach(row => tbody.appendChild(row));
header.dataset.order = ascending ? "asc" : "desc";
});
});
});
</script>
<footer style="text-align: center; margin-top: 20px; font-size: 14px; color: #666;">
© 2025 Iowa State University of Science and Technology, Ames IA 50010. All rights reserved.
</footer>
</body>
</html>
</html>