rt.
            if (e.target.tagName.toLowerCase() === "input") return;
            sortTable(index);
            updateSortArrows(index, ascending);
          });
        });

        // Filter rows as the user types.
        nameFilter.addEventListener("input", function () {
          filterTable(this.value);
        });

        function sortTable(columnIndex) {
          const tbody = table.querySelector("tbody");
          let rows = Array.from(tbody.querySelectorAll("tr"));

          // If sorting on