I have this jquery code that loops through all rows on my table1.
$('#table_1').find('tr').each(function (i, el) {
var $tds = $(this).find('td');
var test1 = $tds.eq(0).text();
var test2 = $tds.eq(1).text();
var test3 = $tds.eq(2).text();
console.log (test1 + test2 + test3);
});
And this is the table where I will pass the values of rows from table1. What I need to do is to dynamically add rows and pass the value within this table until the loop ends. How can I do it using jquery?
<table
style="width: 540px; display: none; float: left; border-collapse: collapse;"
border="1"
>
<tbody>
<tr>
<td> FROM:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> ADDRESS:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> CONTACT NUMBER:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr style="border: none; height: 20px;">
<td style="border: none; text-align: center; height: 20px;" colspan="2">
<strong></strong>
</td>
</tr>
<tr>
<td> TO:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> ADDRESS:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> BARANGAY:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> CITY & PROVINCE:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> CONTACT NUMBER:</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr>
<td> PRODUCT & PRICE</td>
<td>Blah Blah Blah Blah</td>
</tr>
<tr style="border: none; height: 18px;">
<td style="border: none; text-align: center; height: 18px;" colspan="2">
</td>
</tr>
</tbody>
</table>
I hope someone could help me.