From 13ba7048240c054005e3891793dee7bc4b006c47 Mon Sep 17 00:00:00 2001 From: Preston Doman Date: Sat, 16 Feb 2019 16:07:43 -0800 Subject: [PATCH] Fix empty report table message --- front/static/js/viewHistory.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/front/static/js/viewHistory.js b/front/static/js/viewHistory.js index 45407a3..fdf1d2e 100644 --- a/front/static/js/viewHistory.js +++ b/front/static/js/viewHistory.js @@ -290,14 +290,15 @@ function createReportForm(parsedData, type) { function displayListOfReports(parsedData) { const reports = parsedData.reports; + const table = document.querySelector("table"); if (reports.length === 0) { const cardBody = document.querySelector(".card-body"); - const p = document.createElement("p"); - p.innerHTML = "No reports found."; - cardBody.appendChild(p); + const h4 = document.createElement("h4"); + h4.innerHTML = "No reports found."; + h4.classList.add("text-center"); + cardBody.insertBefore(h4, table); } else { - const table = document.querySelector("table"); const tbody = document.querySelector("tbody"); // Insert data into the table row