Im using TCPDF, at the moment im a listing data in two columns using array_chunk which works fine. But i need data to be show in first columns and then second, see below:
Currently:
1 2
3 4
5 6
7 8
9 10
Should be:
1 6
2 7
3 8
4 9
5 10
This is the code:
<?php $array = range(1, 50);?>
<table nobr="true" cellpadding="2">
<?php foreach (array_chunk($array, 2) as $a) { ?>
<tr>
<?php foreach ($a as $array_chunk) { ?>
<td><?php echo $array_chunk; ?></td>
<?php
} ?>
</tr>
<?php } ?>
</table>
my second query(complex) if there are more than 30 rows i need to be able to use $pdf->AddPage(); and continues on the next page.
array_chunkcode in the post. maybearray_slicewould be a better apporach. im unsue about my second query though. - TheDeveloper