【发布时间】:2018-11-02 18:23:46
【问题描述】:
我使用 window.print() 函数来打印带有表格的网页。表头有字体颜色。问题是,在打印时,标题只是黑色的。下面是代码:
<thead>
<tr style="color:red">
<th>Property name</th>
<th>Room number</th>
<th>Month</th>
<th>Tenant name</th>
<th>Rent Required</th>
<th>Rent Paid</th>
<th>Balance</th>
</tr>
</thead>
//按钮
<input type="button" class="btn btn-block
btn-primary btn-xs" value="PRINT"
onclick="window.print() ;" />
有没有办法让它以红色打印表格行?
【问题讨论】:
-
用
<table>标签包围代码,你会得到红色,这里我在打印模式下得到相同的颜色。 jsfiddle.net/5xpbetu1
标签: html printing html-table