Menu icon Foundation
Responsive Tables not working when loaded via ajax

My table works as expected on first page load, but then I have an AJAX call to bring back data from a previous day. When the table appears, its not responsive. I'm calling the same PHP function that the page displays on load. Any thoughts on what could be happening?

tablesAJAX

My table works as expected on first page load, but then I have an AJAX call to bring back data from a previous day. When the table appears, its not responsive. I'm calling the same PHP function that the page displays on load. Any thoughts on what could be happening?

Geoff Kimball about 5 years ago

If your responsive table is initialized with JavaScript (which it probably is), you'll probably need to re-initialize it when you load in new data. I don't know what solution specifically you're using (maybe the one on ZURB Playground?), but basically you'd take whatever function initializes the table, and just run it again after new data is inserted.

ndh about 5 years ago

Hi Geoff,

Yes, I am using the Zurb responsive-tables.js. This is probably a beginner question (and I'm definitely a beginner!) how do I re-initialize?