gpt4 book ai didi

html - 打印时表格行背景颜色不显示

转载 作者:太空狗 更新时间:2023-10-29 15:49:06 24 4
gpt4 key购买 nike

我在表格行中遇到背景颜色问题。

<tr style="background-color:#999999">
<td width="204"> <strong>Opinion</strong></td>
<td width="62"> <strong>Action</strong></td>
<td colspan="4"><strong>Ratings</strong></td>
<td width="54"><strong>Outlook</strong></td>
<td width="93"><strong>Rating Type</strong></td>
</tr>

这段代码工作正常

这是输出

enter image description here

问题

当我想打印此页时。未显示行的 background-color

enter image description here

谁能帮帮我?

最佳答案

将此添加到 tr 样式

 <style>
.row{
background-color:#999999;
-webkit-print-color-adjust: exact;
}
</style>

<tr class="row">
<td width="204"> <strong>Opinion</strong></td>
<td width="62"> <strong>Action</strong></td>
<td colspan="4"><strong>Ratings</strong></td>
<td width="54"><strong>Outlook</strong></td>
<td width="93"><strong>Rating Type</strong></td>
</tr>

关于html - 打印时表格行背景颜色不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33993003/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com