diff --git a/index.html b/index.html
index ffaff62..a17eaf7 100644
--- a/index.html
+++ b/index.html
@@ -45,7 +45,8 @@
diff --git a/start_menu/servizi/start-livebus/css/style.css b/start_menu/servizi/start-livebus/css/style.css
index fa929aa..b513d07 100644
--- a/start_menu/servizi/start-livebus/css/style.css
+++ b/start_menu/servizi/start-livebus/css/style.css
@@ -1,8 +1,8 @@
body {
- background-color: #282828;
- text-align: center;
- color: white;
- font-family: Titillium Web;
+ background-color: #282828;
+ text-align: center;
+ color: white;
+ font-family: Titillium Web;
}
h1 {
@@ -22,15 +22,8 @@ p {
}
#data-container {
- margin-top: 20px;
- max-width: 1000px;
- margin-left: auto;
- margin-right: auto;
- background-color: #333;
- padding: 20px;
- border-radius: 12px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- overflow-x: scroll;
+ min-width: 80%;
+ max-width: 100%;
}
.filter-container {
@@ -69,52 +62,46 @@ p {
}
table {
- width: 100%;
- border-collapse: collapse;
- margin-top: 20px;
- font-size: 15px;
- border-radius: 8px;
- overflow: hidden;
+ border-collapse: separate;
+ border-spacing: 0;
+ border: 1px solid #444;
+ border-radius: 16px;
+ overflow: hidden;
+ min-width: 85%;
+ max-width: 100%;
+ margin: 18px auto;
}
-table th:nth-child(6),
-td:nth-child(6){
- display: none;
+/*Linee verticali*/
+th:not(:last-child),
+td:not(:last-child) {
+ border-right: 1px solid #444;
}
-table,
-th,
-td {
- border: 1px solid #e0e0e0;
+/*Linee orizzontali*/
+tr:not(:last-child) > th,
+tr:not(:last-child) > td {
+ border-bottom: 1px solid #444;
}
th {
background-color: slategray;
color: white;
- padding: 12px;
- text-align: left;
+ text-align: center;
+ padding: .7vw;
}
td {
- padding: 10px;
- background-color: dimgray;
+ padding: .7vw;
+ background-color: #282828;
color: white;
}
tr:nth-child(even) td {
- background-color: gray;
-}
-
-tr:hover td {
- background-color: darkgray;
+ background-color: rgb(60, 60, 60);
}
@media (max-width: 768px) {
- table th:nth-child(4),
- td:nth-child(4){
- display: none;
- }
-
.filter-container input{
margin-top: 5px;
}
@@ -122,6 +109,9 @@ tr:hover td {
.filter-container button{
margin-top: 75%;
}
+ #data-container {
+ overflow-x: scroll;
+ }
}
button {
diff --git a/start_menu/servizi/start-livebus/js/script.js b/start_menu/servizi/start-livebus/js/script.js
index c81eeb0..42aa43a 100644
--- a/start_menu/servizi/start-livebus/js/script.js
+++ b/start_menu/servizi/start-livebus/js/script.js
@@ -42,24 +42,38 @@ function applyFilter() {
const table = document.createElement('table');
// Aggiungi l'intestazione della tabella
- const header = table.createTHead();
- const headerRow = header.insertRow();
- headerRow.insertCell().textContent = 'Zona';
- headerRow.insertCell().textContent = 'Linea';
- headerRow.insertCell().textContent = 'Fermata';
- headerRow.insertCell().textContent = 'Codice Fermata';
- headerRow.insertCell().textContent = 'Veicolo';
- headerRow.insertCell().textContent = ' ';
- headerRow.insertCell().textContent = 'Ultimo Aggiornamento';
+ var th = document.createElement('th');
+ var tr = document.createElement('tr');
+ th.innerHTML='Zona';
+ tr.appendChild(th);
+ th = document.createElement('th');
+ th.innerHTML='Linea';
+ tr.appendChild(th);
+ th = document.createElement('th');
+ th.innerHTML='Fermata';
+ tr.appendChild(th);
+ th = document.createElement('th');
+ th.innerHTML='Codice fermata';
+ tr.appendChild(th);
+ th = document.createElement('th');
+ th.innerHTML='Veicolo';
+ tr.appendChild(th);
+ th = document.createElement('th');
+ th.innerHTML='Ultimo aggiornamento';
+ tr.appendChild(th);
+ table.appendChild(tr);
// Aggiungi i dati alla tabella
- const tbody = table.createTBody();
data.forEach(row => {
- const rowElement = tbody.insertRow();
+ const rowt = document.createElement('tr');
row.forEach(cellData => {
- const cell = rowElement.insertCell();
- cell.textContent = cellData;
+ if(cellData!=""){
+ const cell = document.createElement('td');
+ cell.innerHTML = cellData;
+ rowt.appendChild(cell);
+ }
});
+ table.appendChild(rowt);
});
// Aggiungi la tabella alla pagina