I want to create a table with html tags as strings, passing in the source code values from a 2d array. I create a string and inside it I pass my variables The desired format of the table data part is the following
<tr><td><td>CONTACT1 </td><td>125 </td><td>1 </td></td></tr>
<tr><td><td>CONTACT2 </td><td>126 </td><td>2 </td></td></tr>
<tr><td><td>CONTACT3 </td><td>127 </td><td>3 </td></td></tr>
<tr><td><td>CONTACT4 </td><td>128 </td><td>4 </td></td></tr>
But instead of this I get the following
<tr><td><td>CONTACT1 </td><td>125 </td><td>1 </td>
<td><td>CONTACT2 </td><td>126 </td><td>2 </td>
<td><td>CONTACT3 </td><td>127 </td><td>3 </td>
<td><td>CONTACT4 </td><td>128 </td><td>4 </td></td></tr>
I am trying with the following for loop
for (int i = 0; i < PlayerCount; i++)
{
for (int j = 0; j < 12; j++)
{
col = "<td>" +
contactsarray[i][j] +
" " +
"</td>";
mainsource = mainsource + col;
}
row="<tr><td>"+mainsource+"</td></tr>"+row;
}
How I am going to change table row and achieve the desired result by putting extra and for each contact?