I'm using TCPDF in CakePHP and trying to make some background (grey) for few cells. Well here the idea:
so the grey thing would somehow开发者_StackOverflow have to be define outside of the cells containg text.
Any ideas?
Paultry this.
$this -> TCPDF -> SetFillColor(249,249,249); // Grey
$this -> TCPDF -> Cell(95,$cellHigh,$data,'L',0,'L',$fill,'',0,false,'T','C');
The TCPDF example No. 5 will give you different background colors.
Easiest way is to deliver your content as HTML with some simple formating included.
Check example 6 from TCPDF examples
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.
background-color:transparent
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);
精彩评论