JSFiddle - React, Tailwind, and code Playground
JavaScript
console.log("Populating the tables with data now.");
var tableRowData2 = "";
var finalTableData = "";
for(j = 0; j < data.employeeInsuranceData.length; j++)
{
if (data.employeeInsuranceData[j].employeeData == undefined || data.employeeInsuranceData[j].employeeData == null) {
//Error#4
console.log("Error#4: The employee data is" + data.employeeInsuranceData[j].employeeData + " for some reason!");
}
else {
//Do nothing. Everything is good.
}
console.log("This is pass#: " + j + "!");
var tableRowData;
var forum = data.employeeInsuranceData[j].employeeData;
for (f = 0; f < forum.length; f++) {
var end = columnArray.length - 1;
var object = forum[f];
for(property in object)
{
var value = object[property];
if (property === columnArray[end]) {
tableRowData = "<td>" + value + "</td></tr><tr>";
}
else {
tableRowData = "<td>" + value + "</td>";
}
tableRowData2 += tableRowData;
tableRowData = "";
}
}
finalTableData = "<tr>" + tableRowData2 + "</tr>";
$(finalTableData).appendTo("#dataTable" + j + " tbody");
tableRowData2 = "";
};
console.log("table(s) poopulated");