Ich muss PDF-Seite basierend auf PHP foreach Ergebnis generieren und 2 Spalten anzeigen (A4 PDF Landscape-Modus). Für z.B. Daten wie folgt aussehen:PHP foreach Zeilen zu 2 Spalte
Row data 1
Row data 2
Row data 3
Row data 4
Row data 5
Row data 6
, wenn die Höhe in PDF Spalte 1 (HTML-Tabelle) überschreitet, wird es auf der 2. Spalte der Seite bewegen und es sieht so aus:
Row data 1 Row data 7
Row data 2 Row data 8
Row data 3 Row data 9
Row data 4
Row data 5
Row data 6
Mein Code:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<thead>
<tr>
<th width="140px">Subject</th>
<th width="100px">Teacher</th>
<th width="8%">Exam</th>
</tr>
</thead>
<tbody>
<?php
foreach($data as $std)
{
?>
<tr>
<td><?php echo $std->data1; ?></td>
<td><?php echo $std->data2; ?></td>
<td><?php echo $std->data3; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
Also, was ist Ihre Frage? –
was hast du vorher versucht? – user3663