crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

Table with background color does not work #626

Open cedriclajato opened 2 years ago

cedriclajato commented 2 years ago

<script> function awnow(){ printJS({ printable: 'print', type: 'html', targetStyles: ['*'] }); } </script>

cedriclajato commented 2 years ago

pring-table

wmcat commented 2 years ago

you can try , more setting -> options -> second option

15521260291 commented 2 years ago

I have the same problem. How did you solve it?

wmcat commented 2 years ago

I have the same problem. How did you solve it?

修改打印设置 彩色选项不要选择黑白

15521260291 commented 2 years ago

好的,谢谢。请问可以配置成默认是彩色选项吗

wmcat commented 2 years ago

好像设置了一次 下次默认就是彩色的了把 不知道有没有其他方法 你可以查下

ProfNuru commented 2 years ago

I used the react-to-print package in React instead

TingNLP commented 1 year ago

@crabbly Hi, background-color:red not work on headerStyle、gridHeaderStyle、gridStyle how to solve it ?

TingNLP commented 1 year ago

@crabbly Hi, background-color:red is not work on headerStyle、gridHeaderStyle、gridStyle how to solve it ?

I find solution. Just need to add -webkit-print-color-adjust: exact;

see the docs according to your browser. https://developer.mozilla.org/en-US/docs/Web/CSS/print-color-adjust

nesic998 commented 6 months ago

@TingNLP This: -webkit-print-color-adjust: exact; really helps. Thanks! <3