Добавить -webkit-linear-gradient в строку html таблицы
нужно вставить градиент не на всю строку, а с 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; }
ссылка на пример
http://jsfiddle.net/cpLuye4d/2/
Ответы (1 шт):
Автор решения: Сергей Маяк
→ Ссылка
Вам надо применить градиент к строке, начиная с 3-его столбца, а вы применяете, начиная с 1-ого. Для начала, стоит добавить в градиент прозрачность до 3-его столбца, например, так:
<style>
tbody {
background: -webkit-linear-gradient(left, transparent 40%,
#729fcf 40% 45%, #93971c 45% 50%, #16eab7 50% 65%, #427b70 65% 75%, #861d53 75% 90%, #729fcf 90% 95%, green 0);
}
</style>
Но как угадать, сколько именно % ширины займут 1-ый и 2-ой столбцы? Задать это самим:
<style>
th:nth-of-type(1), td:nth-of-type(1),
th:nth-of-type(2), td:nth-of-type(2) {
width: 20%;
}
</style>
P.S. сейчас всё ещё надо добавлять префикс браузера к таким свойствам, как linear-gradient?

