/
index.html
51 lines (43 loc) · 1.84 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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON to HTML Table</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<script src="script.js"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body class="bg-gray-100 ">
<script>
$(document).ready(function () {
$("#convertBtn").on("click", function () {
$("#jsonTable").removeClass("hidden");
});
});
</script>
<div class="container mx-auto my-8 ">
<h1 class="text-3xl font-bold mb-4 center" style="text-align: center !important;">JSON to HTML Table</h1>
<div class="overflow-x-auto max-w-full flex justify-center items-center">
<table id="jsonTable" class="hidden table-auto">
<thead class="bg-gray-200">
<tr>
<th class="text-left bg-gray-300 ">Key</th>
<th class="text-left ">Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div id="jsonInputContainer" class="mt-4">
<textarea id="jsonInput"
class="w-full h-32 border border-gray-300 rounded-md resize-none p-2 focus:outline-none focus:ring focus:border-blue-300 placeholder-gray-400"
placeholder="Enter raw JSON or endpoint here..."></textarea>
<button id="convertBtn"
class="mt-2 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring focus:border-blue-300">Convert</button>
</div>
</div>
</body>
</html>