2 datatables on 1 page & dataTables_filter

2 datatables on 1 page & dataTables_filter

marcelnl1marcelnl1 Posts: 1Questions: 0Answers: 0
edited January 2012 in DataTables 1.8
Using two datatables on one page is working absolutely flawless, however I am experiencing issues with the dataTables_filter class which is used for the searchbox.

I can without a problem restyle this box using the dataTables_filter class, but this will restyle the box for both tables, but i need to use different styles for each tables.

Does anyone have a clue as to how to do this?

Replies

  • allanallan Posts: 61,867Questions: 1Answers: 10,136 Site admin
    Yup - you need to target your CSS selectors suitably :-).

    DataTables automatically adds a DIV wrapper around the table with an ID of {tableid_wrapper}. So if your table has an ID you can do:

    [code]
    #table1_wrapper div.dataTables_filter {...}
    #table2_wrapper div.dataTables_filter {...}
    [/code]

    Allan
This discussion has been closed.