Add additional container for the table in DT 2
Add additional container for the table in DT 2
Link to test case: https://live.datatables.net/lecimido/1/
Debugger code (debug.datatables.net): none
Error messages shown: none
Description of problem:
Using the dom option, we can add a container for the table like "<'table-responsive' tr>"
. How can we achieve the same result using the new layout option? We prefer horizontal scroll vs the responsive
option. Adding the container in the whole DT instance will also scroll the other parts like pagination and we would like to avoid that.
Thanks in advance for your help!
Replies
Hi,
Currently you need to use
initComplete
to add the class to the container. See this thread for more details.Allan
Thanks for the answer, Allan. I would like to have a new div container of the table and not a new class.
Using layout - https://live.datatables.net/yufisivi/4 , I would like to upgrade to this version https://live.datatables.net/lecimido/1/ where horizontal scroll is enabled if multiple columns do not fit the screen.
Using layout:
VS with table-responsive container using dom:
Ohh my bad.. got it now. https://datatables.net/forums/discussion/comment/230850/#Comment_230850 is indeed the workaround.
Thanks a lot!