How do I create several tables with the same settings?

How do I create several tables with the same settings?

akreiderakreider Posts: 33Questions: 0Answers: 0
edited August 2013 in General
Is there a way to create several tables with the same datatable settings without having to enter them each time?

For instance, I've got a table called 'sub-tag' and I want to reuse the same dataTable settings for another table called 'sub-link'.

[code]
sub_tag=$("#sub-tag").dataTable({"iDisplayLength":20, "bLengthChange":false, "bFilter":false, "bAutoWidth":false,
"sDom": 'lfrt',
"aoColumns": [{"bSortable":true}, {"bSortable":false}],
"aoColumns": [{"sType":"html"}, null]});
[/code]

Replies

  • allanallan Posts: 63,503Questions: 1Answers: 10,471 Site admin
    See http://datatables.net/release-datatables/examples/basic_init/multiple_tables.html

    Allan
This discussion has been closed.