I have 5 tabs that I would like to have the data styled
But it only works for the first tab
This question has an accepted answers - jump to answer
can't remember how to upload my code example
ok I got it now
All of your tables have the same id. HTML requires the id to be unique on the page. You can use a selector that selects all the tables, assuming they all have the same configuration. Something like this:
See this example for more details.
ok that works!! thanks for the quick reply appreciate it
one last question: why does the second column "Action" show next to the first column? If I click it - it does align up correctly
Sounds like you need to use columns.adjust() when you switch tabs. See this example for more details.
not quite understanding.
$('#container').css( 'display', 'block' );
can you show on my code?
Looks like you might have a custom tab library? Presumably you have an event or callback for whenever the tab changes? That's where you would call the code Kevin suggested.
You need to place it in the modExcl() function where you are changing tabs. See the updated example:
Also you need to create unique id's for each table for the $.fn.dataTable.tables() call to work. Otherwise it will only find the last table with same id.
dang you're good!!! Thanks that does the trick
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.