Set cell borders as dashed in tcpdf WriteHTML

元气小坏坏 提交于 2019-12-10 11:58:26

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/5352500/set-cell-borders-as-dashed-in-tcpdf-writehtml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!