您需要插入一个渐变,而不是在整行上,而是从 3 到 5 列,它必须是这样的
<table>
<thead>
<tr>
<th>---</th>
<th>---</th>
<th>First</th>
<th>Second</th>
<th>Three</th>
</tr>
</thead>
<tbody>
<tr>
<td>not gradient</td>
<td>not gradient</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
* {margin:0;padding:0;border:0;border-collapse:collapse;}
table {
width:100%;
}
th, td {
border: 2px solid black;
text-align: center;
}
tbody {
background: -webkit-linear-gradient(left, #729fcf 10%, #93971c 10% 20%, #16eab7 20% 35%, #427b70 35% 45%, #861d53 45% 60%, #729fcf 60% 80%, green 0);
background-attachment:fixed;}
thead tr, thead th { background:transparent; }
链接到示例