function generateTable() { var data = score_table; // The variable from model_scores.js var table = ''; table += ``; // sort data to make sure the best model is on top first_row = '-' // "Human Performance*" console.log(data); // get all keys in data var keys = Object.keys(data); // remove "Human Performance*" from keys var index = keys.indexOf(first_row); if (index > -1) { keys.splice(index, 1); } // add "Human Performance*" to the top of keys keys.unshift(first_row); console.log(keys); // for (var key in data) { for (var i=0; i${key}` // for key = "1", "2", "3" top_ranks = ["1", "2", "3"] if (top_ranks.includes(key)) { table += ``; table += ``; table += ``; table += ``; table += ``; // .toFixed(1): round to 1 decimal place } else { table += ``; table += ``; table += ``; table += ``; table += ``; // .toFixed(1): round to 1 decimal place } // if entry.FQA is a number if (!isNaN(entry.FQA)) { table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; } else { table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; table += ``; } table += ''; } table += '
# Model Method Source Date ALL FQA GPS MWP TQA VQA ALG ARI GEO LOG NUM SCI STA
${entry.Model}${entry.Method}Link${entry.Date}${entry.ALL.toFixed(1).toString()}${entry.Model}${entry.Method}Link${entry.Date}${entry.ALL.toFixed(1).toString()}${entry.FQA.toFixed(1).toString()}${entry.GPS.toFixed(1).toString()}${entry.MWP.toFixed(1).toString()}${entry.TQA.toFixed(1).toString()}${entry.VQA.toFixed(1).toString()}${entry.ALG.toFixed(1).toString()}${entry.ARI.toFixed(1).toString()}${entry.GEO.toFixed(1).toString()}${entry.LOG.toFixed(1).toString()}${entry.NUM.toFixed(1).toString()}${entry.SCI.toFixed(1).toString()}${entry.STA.toFixed(1).toString()}${entry.FQA.toString()}${entry.GPS.toString()}${entry.MWP.toString()}${entry.TQA.toString()}${entry.VQA.toString()}${entry.ALG.toString()}${entry.ARI.toString()}${entry.GEO.toString()}${entry.LOG.toString()}${entry.NUM.toString()}${entry.SCI.toString()}${entry.STA.toString()}
'; document.getElementById('testmini_leaderboard').innerHTML = table; // Assuming you have a div with id 'container' where the table will be placed } // Call the function when the window loads window.onload = generateTable;