Skip to content

Commit d68607e

Browse files
committed
Allow setting table class
Allow styling of the table with other table classes. E.g. BS3 table-striped
1 parent 754b68c commit d68607e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reactive-datatable-template.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Template.ReactiveDatatable.rendered = function() {
1010
// Help Blaze cleanly remove entire datatable when changing template / route by
1111
// wrapping table in existing element (#datatable_wrap) defined in the template.
1212
var table = document.createElement('table');
13-
table.className = 'table dataTable';
13+
var tableClasses = data.options.tableClasses || "";
14+
table.className = 'table dataTable ' + tableClasses;
1415

1516
// Render the table element and turn it into a DataTable
1617
this.$('.datatable_wrapper').append(table);
@@ -25,4 +26,4 @@ Template.ReactiveDatatable.rendered = function() {
2526
this.autorun(function() {
2627
reactiveDataTable.update(data.tableData());
2728
});
28-
};
29+
};

0 commit comments

Comments
 (0)