, . , , OP, , . . , . , ,
<table>
<tr>
<th>header 1</th>
<td>body 1</td>
</tr>
<tr>
<th>header 2</th>
<td>body 2</td>
</tr>
</table>
, :
<table>
<tr>
<th>header 1</th>
<th>header 2</th>
</tr>
<tr>
<td>body 1</td>
<td>body 2</td>
</tr>
</table>
So the solution is to save two arrays, one for the headers and one for the cells of the body. When you finish getting all your strings and the arrays are full, then generate your HTML.
source
share