
function downloadExcel() {
    var table = document.getElementById("editors-table");
    var rows = table.rows;
    var csv = '';
    for (var i = 0; i < rows.length; i++) {
        var cols = rows[i].cells;
        var rowData = [];
        for (var j = 0; j < cols.length; j++) {
            rowData.push(cols[j].innerText);
        }
        csv += rowData.join("\t") + "\n";
    }
    var hiddenElement = document.createElement('a');
    hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
    hiddenElement.target = '_blank';
    hiddenElement.download = 'editors_info.xlsx';
    hiddenElement.click();
}

function filterSubStatus() {
    var subStatus = document.getElementById('subStatus').value;
    var rows = document.getElementById('editors-table').getElementsByTagName('tr');
    for (var i = 1; i < rows.length; i++) {
        var row = rows[i];
        var showRow = true;
        var status = row.getAttribute('data-editors-table');
        if (subStatus !== 'all' && status !== subStatus) {
            showRow = false;
        }
        row.style.display = showRow ? '' : 'none';
    }
}