简体   繁体   English

向 HTML 表添加新行

[英]Adding New Row To HTML Table

I just wanna ask how can I add a new row to an HTML table?我只想问如何在 HTML 表中添加新行?

The first column should have a select tool and the second column should have a text box.第一列应该有一个select工具,第二列应该有一个文本框。 Like there's a button below the table that when clicked, a new row will be added to the table.就像表格下方有一个按钮,单击该按钮时,表格中将添加一个新行。 I really don't know how so perhaps can you give me a sample code?我真的不知道怎么可能你能给我一个示例代码吗? Thank you in advance!先感谢您!

There are several ways using DOM and javascript: just a search on google: http://www.codeproject.com/KB/scripting/DHTMLGrid.aspx http://www.mredkj.com/tutorials/tableaddrow.html There are several ways using DOM and javascript: just a search on google: http://www.codeproject.com/KB/scripting/DHTMLGrid.aspx http://www.mredkj.com/tutorials/tableaddrow.html

<tr>[whatever you need]</tr>

Of course, it would be better if you could describe your situation better.当然,如果你能更好地描述你的情况会更好。 Considering that 'PHP' tag is there.考虑到“PHP”标签就在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM