Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function insCell() { var x=document.getElementById('tr2').insertCell(0); x.innerHTML="John"; } </script> </head> <body> <table border="1"> <tr id="tr1"> <th>Firstname</th> <th>Lastname</th> </tr> <tr id="tr2"> <td>Peter</td> <td>Griffin</td> </tr> </table> <br /> <input type="button" onclick="insCell()" value="Insert cell"> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself