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: 14,519Questions: 25Answers: 3,450

    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: 14,519Questions: 25Answers: 3,450

    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.