I have the next array
$arreglo=[1,2,3,4,5..50]
I want to show that array in a table but I want that table have 10 columns, for example:
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
etc...
the number of rows depends on the size of the array divided by 10, for example if I have 50 elements that means that I will have 5 rows (50/10)
I have the next code but doesn't work:
$html2 =
'<br>
<br>
<br>
<table style="border: 1px solid #333; text-align:center; line-height: 20px; font-size:10px">';
for($j=1;$j<=$rows;$j++){
$html2.='<tr>';
for($k=1;$k<=$cols;$k++){
$html2.='<td style="border: 1px solid #666;">Caja#1'.$datos[$k].'</td>';
}
$html2.='</tr>';
}
$html2.='</table>';
How could I do this?