How do i append a tbbody and row to a already created table in javascript. So far i have done this

 
 function createTable {
 	var tbl = document.getElementsByTagName('table')[0];
   
    var tblbdy = document.createElement('tbody');

    for (var i = 0; i <= 99; i++){

      var tblrw = document.createElement('tr');

      for (var j = 0; j <= 7; j++){

        var tbltd = document.createElement('td');
        var tbldata = document.createTextNode('text for' + j + "is here");
        
        tbltd.appendChild(tbldata);
        tblrw.appendChild(tbltd);

      }

      tblbdy.appendChild(tblrw);


    }

      tbl.appendChild(tblbdy);

      alert("done");
 }

 createTable();

So your problem is in your very first line.

let createTable = function(){

or

function createTable(){

The only real problem? You’re missing the parenthesis.

Ha yes. I have fixed that. But i am still getting this error

Uncaught TypeError: tbl.appendChild is not a function
at createTable (script.js:26)
at script.js:30