about multiples table

about multiples table

Tavo521Tavo521 Posts: 3Questions: 1Answers: 0

I have two tables with the same header, I am using the sentence "$ ('table.display'). DataTable ()" to construct their datatable. My problem is the following table 1 is small and table 2 is my big one.

I have come across that $ ('table.display'). DataTable () does not allow the use of any command such as ScrollY, ScrollColapse etc.

Could you guide me how this problem can be solved.

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    If you want different configurations for the tables then use a more specific selector and initialize each one separately. For example:

    $('#table`).DataTable();
    
    $('#table2').DataTable({
      scrollY: 300,
      ....
    });
    

    Kevin

  • Tavo521Tavo521 Posts: 3Questions: 1Answers: 0

    Those tables are on the same page and I had understood that you can only use a single datatable

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    See this example with different configs for each table:
    http://live.datatables.net/xudowebe/1/edit

    The key is the jQuery selector used.

    Kevin

  • Tavo521Tavo521 Posts: 3Questions: 1Answers: 0

    Thank, i probe with two table and work very fine

Sign In or Register to comment.