Skip to Content
Menu
This question has been flagged
1 Reply
2279 Views

I preset the background color of the table, such as < bgcolor = # fff >. When wkhtmltopdf is not installed, the preview will display normally, but when wkhtmltopdf is installed, there is no bgcolor. What is this? Of course, I also tried several versions of wkhtmltopdf

Avatar
Discard
Best Answer

Hello drt,


try following code for apply background color

background-color:#E0E0E0;


Avatar
Discard
Author

Thank you, but I didn't use CSS, I just defined it in the HTML tag

Then write following code in your table tag

<table style="background-color:#E0E0E0;">

// YOUR CODE HERE.....

</table>

Author

Thank you. It works for the whole table, but I need to mark each line with different colors. Then there is another problem. My font is too small

try this code and put it before your table tag

<style>

tr:nth-child(odd) {

background-color: #FF0000;

}

</style>

Author

非常感谢,起作用了,但是我的html和css技术太差了,想要实现其他的效果我还要继续努力,再次感谢!

Author

Thank you very much, it works, but my HTML and CSS technology is too poor, I have to continue to work hard to achieve other effects, thank you again!

Related Posts Replies Views Activity
2
Jul 24
2925
4
May 24
10063
1
May 24
734
1
Apr 24
1560
2
Feb 24
2180