Question: I just wanted to append `td` in the `tr`

**Table**

```
<table class="u-full-width" id="result">
  <thead>
    <tr>
      <th>Project Name</th>
      <th>Id</th>
      <th>Event</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Dave Gamache</td>
      <td>26</td>
      <td>Male</td>
    </tr> 
  </tbody>
</table>

```

**Script**

```
// Receive Message 
socket.on('message', function(data){
  console.log(data);
  var Project = data.project;
  var Id = data.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](https://i.stack.imgur.com/1yOoJ.png)](https://i.stack.imgur.com/1yOoJ.png)

Answer: 
The last line is wrong. You should append the `tr` to the table, not all the `td`s.

```
document.getElementById("result").appendChild(tr);

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

seems you are appending your tds directly to the table, not a tr in the tbody.