update CSS
This commit is contained in:
@@ -60,7 +60,13 @@
|
|||||||
.red {
|
.red {
|
||||||
background-color: #f44336;
|
background-color: #f44336;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
/* Alignement des cellules numériques à droite */
|
||||||
|
.numeric {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|||||||
@@ -25,16 +25,18 @@
|
|||||||
const colorColumnIndex = 9;
|
const colorColumnIndex = 9;
|
||||||
|
|
||||||
const colorizeCells = () => {
|
const colorizeCells = () => {
|
||||||
const rows = document.querySelectorAll('table tr:nth-child(n+2)'); // Ignore l'en-tête
|
const rows = document.querySelectorAll('table tr:nth-child(n+2)'); // Ignore l'en-tête
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
const cell = row.children[colorColumnIndex];
|
const cell = row.children[colorColumnIndex];
|
||||||
const value = parseFloat(cell.innerText);
|
const value = parseFloat(cell.innerText);
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
if (value > 90) {
|
if (value > 90) {
|
||||||
cell.classList.add('red');
|
cell.classList.add('red');
|
||||||
} else if (value >= 80 && value <= 90) {
|
} else if (value >= 80 && value <= 90) {
|
||||||
cell.classList.add('orange');
|
cell.classList.add('orange');
|
||||||
}
|
}
|
||||||
|
// Appliquer la classe 'numeric' pour l'alignement à droite
|
||||||
|
cell.classList.add('numeric');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user