I have to dynamically render large tables using JavaScript and jQuery in particular. I am doing this by preparing HTML for the table first and doing append then:
var tableHTML = "<table>...</table>";
$("#container").empty().append(tableHTML);
Is this acceptable way to solve the task and if there faster ways of rendering data?
Yes, this is the most efficient way to do that with jQuery. If you wanted to get really fast, you could use bare-bones Javascript:
document.getElementById('container').innerHTML = tableHTML
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With