How to add table row in a table using jQuery?
jQuery can be used to add table rows dynamically. This can be used in web applications where the user may need to add more rows if required.
Steps to add table row:
- The required markup for the row is constructed.
"<tr><td> + information + </td></tr>"
- The table body is selected to which the table rows to be added.
tableBody = $(
- Finally the markup is added to the table body.
- Before clicking the button:
- After clicking the button 4 times: