Answer the question
In order to leave comments, you need to log in
How to update html table with php loop?
There is a regular html table, the content of which is generated in php and displayed in a loop in the markup. The question is: is it possible to somehow update the contents of the table using only the existing markup? If yes, how to do it? Now I send an Ajax request, then I hide the main table and substitute another table generated by the backend in its place, although in fact my request simply changes the contents of the array without touching the structure. Here also it would be desirable to simplify the scenario somehow.
Answer the question
In order to leave comments, you need to log in
If the table structure does not change, you can parse the table obtained through AJAX through DOMParser , and then stupidly through querySelectorAll and the for loop to go through all the cells and update the data in your main table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question