js添加表格行中的单元格用法代码
3672Js.Com2019-03-08 13:48 来源:未知 阅读:16872 关注度5
js添加表格行中的单元格用法代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>3672js教程(3672js.com)</title> <script> function insCell(){ var x=document.getElementById('tr1').insertCell(0); x.innerHTML="The famous"; } </script> </head> <body> <table border="1"> <tr id="tr1"> <td>Peter</td> <td>Griffin</td> </tr> </table> <br> <input type="button" onclick="insCell()" value="插入单元格"> </body> </html>本站文章为3672js教程网友分享投稿,版权归原作者,欢迎任何形式的转载,但请务必注明出处。同时文章内容如有侵犯了您的权益,请联系我们处理。
评论已被关闭