开发者

Set cell borders as dashed in tcpdf WriteHTML

开发者 https://www.devze.com 2023-02-18 04:08 出处:网络
Hi i want to make the border of table cells as dashed lines in TCPDF writehtml()... I have tried using border=1 for tables but only a thick border comes .. also i have tried using css likestyle=\"bord

Hi i want to make the border of table cells as dashed lines in TCPDF writehtml()... I have tried using border=1 for tables but only a thick border comes .. also i have tried using css like style="border-style: dashed;border-width: 1px; " however the bo开发者_高级运维rder remains the same... Can anyone point me in the right direction?


According to the docs, if you’d use writeHTMLCell(), the 6th argument represents the border style. A dashed border would look like:

TCPDF::writeHTMLCell(
    …,
    array(
        'LRTB' => array(
            'width' => 1, // careful, this is not px but the unit you declared
            'dash'  => 1,
            'color' => array(0, 0, 0)
        )
    ),
    …
);

This example (demo) helped me a lot creating tables in PHP with MultiCell() instead of HTML.


style="border:1px dashed;" This is working for me ....

0

精彩评论

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