rows.forEach(row => tableBody.appendChild(row)); // Moves existing rows in sorted order
            }


            function displayApps(apps) {
                const tableBody = document.getElementById('appTable');

                if (tableBody.children.length === 0) {
                    // First-time render (Create all rows once)
                    apps.forEach(app => {
                        const row = document.createElement('tr');
                        row.setAttribute("data-client-id", app.clien