Javascript examples for DOM HTML Element:TableRow
The TableRow object represents an HTML <tr> element.
You can access a <tr> element by using getElementById():
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style>//from ww w. j a va 2 s.co m </head> <body> <table> <tr id="myRow"> <td>First cell</td> <td>Second cell</td> <td>Third cell</td> </tr> </table> <button onclick="myFunction()">delete the first cell from the table row</button> <script> function myFunction() { var row = document.getElementById("myRow"); row.deleteCell(0); } </script> </body> </html>