Black Rider
Black Rider

Reputation: 397

Set cell borders as dashed in tcpdf WriteHTML

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 border remains the same... Can anyone point me in the right direction?

Upvotes: 0

Views: 15073

Answers (2)

David
David

Reputation: 3422

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.

Upvotes: 2

Shaun
Shaun

Reputation: 2311

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

Upvotes: 1

Related Questions