开发者

TCPDF grey background for few cells?

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

TCPDF grey background for few cells?

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

Any ideas?

Paul


try 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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜