DOMPDF表边框问题 [英] DOMPDF table border issue

查看:200
本文介绍了DOMPDF表边框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DOMPDF的最新版本(0.6.0 Beta 3)中遇到了一个非常奇怪的问题.我正在用它来为我的网站上的客户创建发票.设计要求表格单元格之间的边界为1px.如果我使用黑色或#000作为边框颜色,则表格呈现得很好.但是,当我更改颜色时,例如说#CCC,而不是1px边框,边框变为2px.我正在使用border-collapse:collapse,在这上面我已经把头发拉了两天了.除了颜色,我什么都没改变,但是边框的厚度在改变.是否还有其他人遇到此问题并知道解决方案是什么,或有任何建议?为什么黑色渲染1px边框,而其他颜色渲染为2px边框?救命!

I've come across a very strange issue with the latest version of DOMPDF (0.6.0 Beta 3). I'm using it to create invoices for customers on my site. The design calls for 1px borders between the table cells. If I use either black or #000 for the border color, the tables are rendered nicely. However, when I change the color, to say #CCC for example, instead of a 1px border, the borders become 2px. I'm using border-collapse:collapse and I've been pulling my hair out over this for 2 days. I'm not changing anything else except the color, yet the border thickness is changing. Has anyone else run across this issue and know what the solution is or have any suggestions? Why does black render a 1px border but other colors are rendered as 2px borders? Help!

当我阅读到这可能会导致表格出现问题但仍然没有运气的时候,我的空白单元格中也填充了 .

I also have empty cells filled with   as I read that that may cause issues with tables, but still no luck.

推荐答案

这可能会有所帮助.我没有尝试重现您的问题,但是我知道它对我遇到的表问题有所帮助. 尝试将其添加到表的CSS中:

This might help. I have not tried to reproduce your problem, but I know it helped with some issues I was having with tables. try adding this to your css for the table:

table {
    border-collapse: collapse;
}

很显然,您可以在CSS中使用适当的选择器,而不用定义整个表类.

Obviously you can use the appropriate selector in the css and not define the entire table class.

这篇关于DOMPDF表边框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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