动态生成的HTML表内容

动态生成的HTML表内容,html,html-table,Html,Html Table,我有一个HTML表,其中有多个表行和列。 存在对SQL数据库的数据请求。 然后,数据将显示在表体中。 表标题保持不变 但现在问题来了。我不知道为什么所有的数据都写在html表的第一列中。 表标题与要显示的数据不匹配 let table=document.getElementById(“result1”); let row=table.insertRow(-1); 设cell1=row.insertCell(0); 设cell2=row.insertCell(1); 设cell3=row.ins

我有一个HTML表,其中有多个表行和列。 存在对SQL数据库的数据请求。 然后,数据将显示在表体中。 表标题保持不变

但现在问题来了。我不知道为什么所有的数据都写在html表的第一列中。 表标题与要显示的数据不匹配

let table=document.getElementById(“result1”);
let row=table.insertRow(-1);
设cell1=row.insertCell(0);
设cell2=row.insertCell(1);
设cell3=row.insertCell(2);
设cell4=row.insertCell(3);
设cell5=row.insertCell(4);
设cell6=行insertCell(5);
设cell7=row.insertCell(6);
cell1.innerHTML=数据[i]。项目编号;
cell2.innerHTML=数据[i]。项目名称;
cell3.innerHTML=data[i].inhalt;
cell4.innerHTML=数据[i].Baort;
cell5.innerHTML=数据[i]。标准;
cell6.innerHTML=数据[i];
cell7.innerHTML=nutzer[i]

新项目
项目名称
吸入
鲍特
立场
Ausleihdatum
纳泽尔

新项目
项目名称
吸入
鲍特
立场
Ausleihdatum
纳泽尔

新项目
项目名称
吸入
鲍特
立场
Ausleihdatum
纳泽尔
检查这个,特别是问题的解决方案,如果您使用Angular,为什么要“插入行”。您应该使用插值“{}”和“*ngFor”。检查这一项,特别是问题的解决方案,如果您使用Angular,为什么要“插入行”。您应该使用插值“{}}”和“*ngFor”。
<table id="bestand">     
    <tr class="header">
      <th>Projekt Nummer</th>
      <th>Projekt Name</th>
      <th>Inhalt</th>
      <th>Bauort</th>
      <th>Standort</th>
      <th>Ausleihdatum</th>
      <th>Nutzer</th>
    </tr>

    <tr class="header">
      <td><input type="text" [(ngModel)]="query_1" (ngModelChange)="search_1()"></td>
      <td><input type="text" [(ngModel)]="query_2" (ngModelChange)="search_2()"></td>
      <td><input type="text" [(ngModel)]="query_3" (ngModelChange)="onSearch_3()"></td>
      <td><input type="text" [(ngModel)]="query_4" (ngModelChange)="onSearch_4()"></td>
      <td><input type="text" [(ngModel)]="query_5" (ngModelChange)="onSearch_5()"></td>
      <td><input type="text" [(ngModel)]="query_6" (ngModelChange)="onSearch_6()"></td>
      <td><input type="text" [(ngModel)]="query_7" (ngModelChange)="onSearch_7()"></td>
    </tr>


</table>