child not appearing
this code is supposed to create new table rows with 2 new columns in the new rows. but it is not working. please help <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <style> table{ width: auto; align-items: center; } table, th, td{ border:1px solid #000 } </style> <script> window.onload = function () { function tableCrate(inputID, numberOfRows) { var tableBody = document.getElementById('model'); tableCrate('youssef', 2); for (let x = 0; x < numberOfRows; x++) { var newTableRow = document.createElement('tr'); tableBody.appendChild(newTableRow); for (var g = 0; g < numberOfRows*2; g++){ var newTableData = document.createElement('td'); var newInput = document.createElement('input'); newInput.setAttribute('id', inputID); newTableData.appendChild(newInput); } } } } </script> <title>modeling-data</title> </head> <body> <table> <thead> <tr> <th>x</th> <th>y</th> </tr> </thead> <tbody id="model"> </tbody> </table> </body> </html>