-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresentaLLamadas.html
More file actions
110 lines (99 loc) · 2.24 KB
/
presentaLLamadas.html
File metadata and controls
110 lines (99 loc) · 2.24 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tabla JSON</title>
<style>
table {
border-collapse: collapse;
width: 100%;
font-family: Arial, sans-serif;
font-size: 14px;
color: #333;
}
th, td {
border: 1px solid #ccc;
padding: 8px;
}
th {
background-color: #f5f5f5;
text-align: left;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #ddd;
}
@media only screen and (max-width: 768px) {
table {
font-size: 12px;
}
th, td {
padding: 4px;
}
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>idNow</th>
<th>rac</th>
<th>fechaInicio</th>
<th>horaInicio</th>
<th>horaFinal</th>
<th>usuarioNombres</th>
<th>UsuarioApellidoPaterno</th>
<th>UsuarioApellidoMaterno</th>
<th>rut</th>
<th>celular</th>
<th>mail</th>
<th>direccion</th>
<th>calle</th>
<th>numeroDireccion</th>
<th>depto</th>
<th>comuna</th>
<th>referencia</th>
<th>numeroServicio</th>
<th>digitoVerificador</th>
<th>asunto</th>
<th>desarrollo</th>
<th>glosa</th>
<th>recordatorio</th>
<th>numeroAtencion</th>
<th>numeroAviso</th>
<th>numeroOrden</th>
</tr>
</thead>
<tbody id="tabla-body">
</tbody>
</table>
<script>
const input = document.createElement('input');
input.type = 'file';
input.accept = '.json';
input.addEventListener('change', () => {
const file = input.files[0];
const reader = new FileReader();
reader.onload = (event) => {
const data = JSON.parse(event.target.result);
// data.sort((a, b) => a.fechaInicio - b.fechaInicio);
const tablaBody = document.getElementById('tabla-body');
data.forEach(obj => {
const fila = document.createElement('tr');
for (const prop in obj) {
const celda = document.createElement('td');
celda.textContent = obj[prop];
fila.appendChild(celda);
}
tablaBody.appendChild(fila);
});
};
reader.readAsText(file);
});
document.body.appendChild(input);
</script>
</body>
</html>