How do you append rows to a table using jQuery?

前端 未结 7 1419
渐次进展
渐次进展 2020-12-01 01:34

Hi I was trying to add a row to a table using jQuery, but it is not working.
What might be the reason?

And, can I put in some value to the newly added row..?

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 01:43

    The following code works

    
    
    
    
    
    
    
    
    test
    
    test

    Note this will work as of jQuery 1.4 even if the table includes a element:

    jQuery since version 1.4(?) automatically detects if the element you are trying to insert (using any of the append(), prepend(), before(), or after() methods) is a and inserts it into the first in your table or wraps it into a new if one doesn't exist.

提交回复
热议问题