将单元格边框设置为 tcpdf WriteHTML 中的虚线 [英] Set cell borders as dashed in tcpdf WriteHTML

查看:116
本文介绍了将单元格边框设置为 tcpdf WriteHTML 中的虚线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 TCPDF writehtml() 中将表格单元格的边框设为虚线...我曾尝试对表格使用 border=1,但只有粗边框出现......我也尝试过使用像 style="border-style: dashed;border-width: 1px; " 但是边框保持不变......有人能指出我正确的方向吗?

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?

推荐答案

根据 文档,如果您使用 writeHTMLCell(),则第 6 个参数表示边框样式.虚线边框如下所示:

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)
        )
    ),
    …
);

这个例子 (demo) 帮助我在 PHP 中使用 MultiCell() 而不是 HTML 创建表格.

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

这篇关于将单元格边框设置为 tcpdf WriteHTML 中的虚线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆