Adding cells to a table row
<html> <head> <script type="text/javascript"> function addCell(){ var x=document.getElementById('myTable').rows[0] var y=x.insertCell(2) y.innerHTML="NEW CELL" } </script> </head> <body> <table id="myTable" border="1"> <tr> <td>d</td> <td>d</td> </tr> <tr> <td>d</td> <td>d</td> </tr> <tr> <td>1</td> <td>2</td> </tr> </table> <form> <input type="button" onclick="addCell()" value="Add cell"> </form> </body> </html>