forked from lucaspatenaude/ScoreSpot
More styling added for table
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// script.js
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var goalDifferenceCells = document.querySelectorAll("#standings-table tbody td:nth-child(8)"); // Selecting the cells in the goal_difference column
|
||||
|
||||
goalDifferenceCells.forEach(function(cell) {
|
||||
var goalDifference = parseInt(cell.textContent);
|
||||
|
||||
if (goalDifference < 0) {
|
||||
cell.style.color = "red"; // Change text color to red for negative goal difference
|
||||
} else if (goalDifference > 0) {
|
||||
cell.style.color = "green"; // Change text color to green for positive goal difference
|
||||
} // If goal difference is 0, leave text color unchanged
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user