Refreshing data in HTML for Excel Download

Without knowing your code…
I assume you will need something like this one…

function myFunction() {
  document.getElementById("myTable").deleteRow(0);
}

-Then first get the table-row-length.
-Use a loop.
-Done.
-Create your new table again.