-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.html
More file actions
67 lines (62 loc) · 1.69 KB
/
Copy pathcalculator.html
File metadata and controls
67 lines (62 loc) · 1.69 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JS Calculator</title>
<style>
body { font-family: Arial; padding: 20px; text-align: center; }
input, button { padding: 8px 12px; margin: 5px; font-size: 16px; }
table { margin: 20px auto; border-collapse: collapse; text-align: center; }
th, td { border: 1px solid #ccc; padding: 10px 20px; }
.table-container {
display: flex;
justify-content: center;
gap: 40px; /* spacing between tables */
margin-top: 20px;
}
.table-container > div {
flex: 1;
}
</style>
</head>
<body>
<h2>JS Calculator</h2>
<input id="num1" placeholder="First number">
<input id="operator" placeholder="+ - * / %" maxlength="1">
<input id="num2" placeholder="Second number">
<button id="calcBtn">Calculate</button>
<button id="cancelBtn">Cancel</button>
<div class="table-container">
<div>
<h3>History</h3>
<table id="historyTable" border="1">
<tr>
<th>x</th>
<th>operation</th>
<th>y</th>
<th>result</th>
</tr>
</table>
</div>
<div>
<h3>Statistics</h3>
<table id="stats">
<tr>
<th>Min</th>
<th>Max</th>
<th>Average</th>
<th>Total</th>
</tr>
<tr id="statsRow">
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</table>
</div>
</div>
<!-- Link to external JS file -->
<script src="calculator.js"></script>
</body>
</html>