打印时我无法获得 tr 背景颜色。
我的代码如下。请说明代码有什么问题。
<html>
<head>
<title>Test Employee</title>
<style type="text/css">
@media all {
tr.header {
background-color: red;
}
}
</style>
</head>
<body >
<table border="1" bordercolor="#B4B4B4" cellpadding="1" cellspacing="0" width="100%" >
<thead>
<tr class="header">
<th>Name</th>
<th>Sex</th>
<th>Age</th>
<th>MartialStatus</th>
<th>Address</th>
<th>Emailid</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<tr>
<td>Radha Krishnan </td>
<td>Male</td>
<td>26</td>
<td>Un Married</td>
<td>Coimbatore</td>
<td>test@asasa.com</td>
<td>Team Lead</td>
</tr>
<tr>
<td>Ramesh Kumar</td>
<td>Male</td>
<td>30</td>
<td>Un Married</td>
<td>Trivandrum</td>
<td>rameshk@asdasd.com</td>
<td>Senior Programmer/Analyst</td>
</tr>
<tr>
<td>Mohan Ram</td>
<td>Male</td>
<td>24</td>
<td>Married</td>
<td>sfgsd</td>
<td>asfasf@asfasf.com</td>
<td>Programmer/Analyst</td>
</tr>
</tbody>
</table>
</body>
</html>
谢谢