Create table inside cell

0

Hello. I have a script where I need to add in a td created via javascript a new table. I tried to create the new table directly using something like:

var newTable = cell3_prod.createElement("TABLE");

I thought it would work but it caused error I also tried this:

cell3_prod.appendChild(document.createElement("TABLE"));
var tab_produto = cell3_prod.getElementsByTagName("TABLE");

It has not worked yet. Should that work or does it depend on something else?

    
asked by anonymous 27.07.2017 / 20:01

1 answer

1

I changed the code to

var tab_produto = document.createElement("TABLE");
cell3_prod.appendChild(tab_produto);

and it worked.

Falow !! Thanks!

    
27.07.2017 / 21:27