Take the 2-minute tour ×

I'm using TCPDF in CakePHP and trying to make some background (grey) for few cells. Well here the idea:

alt text

so the grey thing would somehow have to be define outside of the cells containg text.

Any ideas?

share|improve this question
add comment

4 Answers

up vote 0 down vote accepted

Easiest way is to deliver your content as HTML with some simple formating included.

Check example 6 from TCPDF examles

share|improve this answer
add comment

TCPDF is not very good in handling big data export as HTML input. Any alternate?

share|improve this answer
Just got a sample. Here is a link tcpdf.org/examples/example_011.phps –  Azghanvi Mar 14 '13 at 6:43
Another sample here: ibm.com/developerworks/opensource/library/os-tcpdf/… –  Azghanvi Mar 14 '13 at 6:44
add comment

TCPDF has the habit of changing the background color to GREY when it comes across Tables in the HTML when generating the PDF.

The HTML will be usually having this background color tag for table.


whicih makes TCPDF to make it GREY. A simple fix would be just replacing the HTML content with whichever color you like. An example using PHP

$html = str_replace("background-color:transparent","background-color:white", $html);
share|improve this answer
add comment

try this.

$this -> TCPDF -> SetFillColor(249,249,249); // Grey
$this -> TCPDF -> Cell(95,$cellHigh,$data,'L',0,'L',$fill,'',0,false,'T','C');
share|improve this answer
add comment

Your Answer


