DataTables compatibility with WordPress

DataTables compatibility with WordPress

adbrasadbras Posts: 2Questions: 1Answers: 0

I tried to apply DataTables directly hard-coded in the HTML with the JS and CSS libraries for a website in building with WordPress, but the responsive part isn’t working properly. Outside of WordPress it works fine.
I guess the problem has something to do with DataTable’s CSS overlapping with the WP Theme’s CSS, but I have already changed Themes without any improvements to the tables.

The closest I got to have responsive DataTables working was with regular bootstrap.. it kinda works, when I reduce the window size it is responsive, but when I change back to a full sized window without refreshing the page, it doesn't display back the rows that should be available in a desktop window.

Anybody has experience applying DataTables in WP?
I know there are plug-ins to create responsive tables for WP, but for my application I would rather not to use plug-ins because of the way I populate these datatables.

Thanks in advance.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @adbras ,

    This blog post should help - it gives instructions using TablePress for both DataTables and Editor.

    Cheers,

    Colin

  • adbrasadbras Posts: 2Questions: 1Answers: 0

    I already saw that post. I did exactly as it says in the instructions and the table works, until I add the responsive feature. That part I cannot make it work. I think the Theme's CSS is overlapping with DataTables making it's behavior strange.
    I guess that's one of the reasons TablePress plug-in exists...

    I would like to know if there is a way to isolate the table's CSS from the Theme's or if anyone already had this problem and how do I solve it?

This discussion has been closed.