Responsive not working with my datatable

Responsive not working with my datatable

TastechTastech Posts: 3Questions: 1Answers: 0
edited August 2022 in Free community support

Link to test case:
Debugger code (debug.datatables.net):
http://live.datatables.net/liwofibo/92/

Description of problem:
I made a table but when I try to get a responsive table it doesn't work.
Here is the example I want to get it : http://live.datatables.net/yixoxede/25/.

Thanks for your help.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    There are two issues:

        <script src="https://nightly.datatables.net/js/jquery.dataTables.js"></script>
    
    
        <!-- SEARCHPANES -->
        <link href="https://cdn.datatables.net/searchpanes/2.0.1/css/searchPanes.dataTables.css" rel="stylesheet"
            type="text/css" />
        <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
        <script src="https://cdn.datatables.net/searchpanes/1.3.0/js/dataTables.searchPanes.min.js"></script>
        <script src="https://cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js"></script>
    

    First you are loading datatables.js twice; once in line 1 and again in line 5. Only load it once. Remove the nightly version unless you need it for a fix.

    Second you haven't loaded responsive.js. See the examples and use the Download Builder to get the extensions you need.

    Kevin

  • TastechTastech Posts: 3Questions: 1Answers: 0

    @kthorngren Thank you for your answer but this does not solve my problem. Could you look in detail please?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Your example is working for me. Note that Responsive is only applied when the screen size is reduced

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    Answer ✓

    You are loading jquery.js, datatables.js and the extensions multiple times. Only load them once. I used the Download Builder to get the BS 4 styled Datatables with searchBuilder, select, fixedHeader and responsive:
    http://live.datatables.net/liwofibo/95/edit

    Load order for the libraries is import and loading them only once is important.

    Kevin

  • TastechTastech Posts: 3Questions: 1Answers: 0

    Thank you ! actually it worked it was missing BS 4 styled datatables.

Sign In or Register to comment.