How to use .dataTable() with a table filled with .tmpl()

How to use .dataTable() with a table filled with .tmpl()

Hi all,

I've a table populated with .tmpl(), so far so good, now I want to use .dataTable() because I want pagination e and filtering, is it possible?

I've tried in the classic way $('#table-id').dataTable(); but doesn't work.

Any idea?