How to include multiple td into the tr?

I just wanted to append td in the tr


<table class="u-full-width" id="result">
      <th>Project Name</th>
      <td>Dave Gamache</td>


// Receive Message 
socket.on('message', function(data){
  var Project = data.project;
  var Id =;
  var Event = data.event;

  var tr = document.createElement("tr");
  var td1 = tr.appendChild(document.createElement('td'));
  var td2 = tr.appendChild(document.createElement('td'));
  var td3 = tr.appendChild(document.createElement('td'));

  td1.innerHTML = Project;
  td2.innerHTML = Id;
  td3.innerHTML = Event;

  document.getElementById("result").appendChild(td1, td2, td3);

I come up with this above code but this is not working means see the image…

enter image description here

Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.