You need to insert javascript into the printf () function
printf("<script type='text/javascript'> $(function () { $('[data-toggle="tooltip"]').tooltip() }) </script>"); The problem occurs in line 3 with the tooltip. It is highlighted and actually does not work. 
printf? and where did he come from in js? - Alexey Shimansky