Código Javascript:
Ver original
<html> <head> <title>DOM</title> <script type="text/javascript"> function createTable() { var table = document.createElement('table'); var tbody = document.createElement('tbody'); var tr = document.creaateElement('tr'); var td = document.createElement('td'); var text = document.createTextNode('celda 1'); td.appendChild(text); tr.appendChild(td); tbody.appendChild(tr); table.appendChild(tbody); document.getElementById('container').appendChild(table); } </script> </head> <body> <input type="button" value="Crear Tabla" onclick="createTable()" /> <div id="container"></div> </body> </html>