I have a HTML table like this:
DEL 2条回答 南方客 (楼主) 2020-12-04 18:47 Not related to your question but you can make your HTML bit more semantic. DELETE ROWCOL 1 DELETE COLCOL 2 DELETE COLCOL 3 DELETE COLCOL 4 DELETE COLCOL 5 DELETE COLCOL 6 ROW 1 ROW 1 ROW 1 ROW 1 ROW 1 ROW 1 ROW 2 ROW 2 ROW 2 ROW 2 ROW 2 ROW 2 Modified jQuery code may look like: var c = $("#myTable thead th").length; $("#myTable thead tr").append("Delete Col "+(c+1)+""); $("#myTable tr:gt(0)").append("Col"); 0 讨论(0) 查看其它2个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Not related to your question but you can make your HTML bit more semantic.
DELETE ROWCOL 1 DELETE COLCOL 2 DELETE COLCOL 3 DELETE COLCOL 4 DELETE COLCOL 5 DELETE COLCOL 6 ROW 1 ROW 1 ROW 1 ROW 1 ROW 1 ROW 1 ROW 2 ROW 2 ROW 2 ROW 2 ROW 2 ROW 2
Modified jQuery code may look like:
var c = $("#myTable thead th").length; $("#myTable thead tr").append("Delete Col "+(c+1)+""); $("#myTable tr:gt(0)").append("Col");