I believe what you are attempting to do is write out the content of your function inside the table. For this you have to use the <script></script> tags as well as document.write() as follows :
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.