var tableData =
[{'program': 'Program 1', 'To': 'example1', Date: '8/5', Approved: 'Yes', Notes: 'Note', Deliverable: 'Deliverable'},
{'program': 'Program 1', 'To': 'example2', Date: '8/5', Approved: 'Yes', Notes: 'Note', Deliverable: 'Deliverable'},
{'program': 'Program 2', 'To': 'example3', Date: '8/5', Approved: 'No', Notes: 'Note', Deliverable: 'Deliverable'},
{'program': 'Program 3', 'To': 'example4', Date: '8/5', Approved: 'Yes', Notes: 'Note', Deliverable: 'Deliverable'},
{'program': 'Program 3', 'To': 'example4', Date: '8/5', Approved: 'Yes', Notes: 'Note', Deliverable: 'Deliverable'},
{'program': 'Program 3', 'To': 'example4', Date: '8/5', Approved: 'Yes', Notes: 'Note', Deliverable: 'Deliverable'}]
//Fake loadData(...)
Promise.all(tableData)
.then((r1) => {
const objItems = r1;
makeTable(objItems);
})
function makeTable(tableData){
var group = {};
for(var d of tableData){
if(group[d.program]){
group[d.program].push(d);
} else {
group[d.program] = [d];
}
}
var tableContent = ''; // I put the table in the html but you can populate it here
for (var prop in group) {
tableContent += "<tr>";
tableContent += "<td rowspan=\""+ group[prop].length +"\">" + prop + "</td>";
tableContent += "<td>" + group[prop][0].To + "</td>";
tableContent += "<td>" + group[prop][0].Date + "</td>";
tableContent += "<td>" + group[prop][0].Approved + "</td>";
tableContent += "<td>" + group[prop][0].Notes + "</td>";
tableContent += "<td>" + group[prop][0].Deliverable + "</td>";
tableContent += "</tr>";
for(var i = 0; i < group[prop].length - 1; i++){
tableContent += "<tr>";
tableContent += "<td>" + group[prop][i+1].To + "</td>";
tableContent += "<td>" + group[prop][i+1].Date + "</td>";
tableContent += "<td>" + group[prop][i+1].Approved + "</td>";
tableContent += "<td>" + group[prop][i+1].Notes + "</td>";
tableContent += "<td>" + group[prop][i+1].Deliverable + "</td>";
tableContent += "</tr>";
}
}
$("#deliverablesTable").append(tableContent);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="deliverablesTable" style="width:100%" border="1 px">
<thead>
<tr>
<td><strong>Program</strong></td>
<td><strong>To</strong></td>
<td><strong>Date</strong></td>
<td><strong>Approved</strong></td>
<td><strong>Notes</strong></td>
<td><strong>Deliverable</strong></td>
</tr></thead><tbody>