I am trying to clone 2 columns from a table to a new table using jQuery.
The source table is below:
-
2021-01-18 16:21
I have goog way, how to play with columns, i write here full code:
function add_column(copy, paste)
{
$("."+copy+":first").clone().appendTo("."+paste);
$("."+paste+" tr:last input").val('');
$("."+paste+" tr:last select").val('');
// and etc...
}
function remove_column(e, paste)
{
var how = $("."+paste+" tr").length;
if(how >= 2)
{
$(e).parent().parent().remove();
} else {
$("."+paste+" input").val('');
$("."+paste+" select").val('');
// and etc...
}
}