   document.addEventListener("DOMContentLoaded", function () {
        const table = document.querySelector("table");
        const headers = table.querySelectorAll("th");
        const nameFilter = document.getElementById("nameFilter");
        let currentSortedColumn = 0;
        let ascending = true;

        // Add sorting listeners
        headers.forEach((header, index) => {
          header.addEventListener("click", function (e) {
            // Prevent clicks on the filter input from triggering a so