I'm doing a report generator with codeigniter and I'm using tcpdf to create my PDF files.
First I create the table from the query result in codeigniter like this:
$query = $this->db->query($sql);
$html = $this->table->generate($query);
Then I use the html as the PDF content like this:
$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
$pdf->Output($data['path'] . $data['file_name'] . '.pdf', 'F');
Everything is fine but sometimes the table just won't appear, the rest of the PDF like the header is just fine but the table won't show.
I think is some kind of overflow because the table won't appear when the content inside a row is too long.
I've tried to set the max width of the columns doing this:
.normal_row{
background-color: #FFFFFF;
height: 1em;
max-width: 200px;
}
But it didn't work.
Any ideas on how to fix this problem?