Reputation: 750
I have a MySQL code which people list up x amount of information and this goes in two columns. I have grouped these people in departments and there is a department header for each on the page.
I would like to break the column and start from the top again when the department would not fit in the same column.
Have anyone experienced the same issue? Any help would be appreciated:)
thanks
Upvotes: 1
Views: 2756
Reputation: 106
I just ran in to the same issue, and I dealt with it by checking my current position in the page. If the position is too low in the page for the content that I know will be there (and thus flow to the next column) I select the next column before outputting. Here is a sample of my code:
if ($tcpdf->GetY() > 188)
$tcpdf->selectColumn($tcpdf->getColumn() + 1);
$tcpdf->writeHTMLCell(120, 3, $tcpdf->GetX(), $tcpdf->GetY(), $html, '', 1);
Upvotes: 4