data[0] -> data

This commit is contained in:
Huang,Yonggang 2024-06-09 16:26:08 +08:00
parent d932f53567
commit 6a5b2ac8e8
1 changed files with 1 additions and 2 deletions

View File

@ -183,8 +183,7 @@
function createTableHTML(data) {
let tableHTML = '<table border="1"><tr>';
alert(tableHTML);
Object.keys(data[0]).forEach(key => {
Object.keys(data).forEach(key => {
tableHTML += `<th>${key}</th>`;
});
alert(tableHTML);