Home » Javascript » Unable to apply floatThead to dynamically created table

Unable to apply floatThead to dynamically created table

Posted by: admin November 1, 2017 Leave a comment

Questions:

I got the floatThead plugin working for a static table.
I am however unable to get it work for a dynamically created table.

JSfiddle

In the above JSfiddle the user uploads an excel file. It will then be transformed into an HTML table. The problem with it is that I am unable to apply the floating thead plugin to it.

I tried invoking it in different ways but none of them worked:

$('#tbl').floatThead('reflow');

$('#tbl').trigger('reflow');

$('#tbl').floatThead();

$(document).on('load', '#tbl', function(e) {
    $(this).floatThead();
});
Answers: