I have a little problem with getting a new <tr> after every 5 <td> when making a PDF using TCPDF:
$bricks = "";
$bricks .= '<table>';
$bricks .= '<tr>';
foreach($bricks_selected as $key => $value) {
$num_check = substr($value, 4);
if($num_check != "0") {
$bricks .= '<td width="90" height="80"><img src="/var/www/brickmixer/bricks/tavler/RT'.substr($value, 0, 3).'.jpg" width="80" height="55"><br><b>RT '. substr($value, 0, 3) .' - '. $num_check .'%</b></td>';
}
}
I have tried with division etc. but it gives me some funny results.
The $bricks_selected variable are set in the top of the script:
foreach($_POST as $key => $value) {
if($key == "bricks-selected") {
$bricks_selected = explode("&", $value);
}
}
Add an incremental variable and check every 5
td‘s: