简单教程
提交运行
代码编辑器:
<script> function displayResult(){ var firstRow=document.getElementById("myTable").rows[0]; firstRow.deleteCell(0); } </script> <table id="myTable" border="1"> <tr> <td>First cell</td> <td>Second cell</td> <td>Third cell</td> </tr> </table> <br> <button type="button" onclick="displayResult()">删除第一个单元格</button>
运行结果: