As shown in the picture, clicking the Add a Row button will add a row. After filling in the data, click Save below and it will be inserted into the database. The question now is how to get all the data in the table? Please post the code
var set = [];
$('table tr').each(function() {
var row = [];
$(this).find('td').each(function() {
row.push($(this).text());
});
set.push(row);
});
In this way, all the td items in the entire table will be stored in a two-dimensional array set in order from row to column, similar to the structure below
In this way, all the td items in the entire table will be stored in a two-dimensional array set in order from row to column, similar to the structure below