I have tried out background-image: linear-gradient(to top, red 50%, green 50%)
.
But It's covering the whole checkbox and add colours from top to bottom.
I want to apply only on the left side border only.
I have tried out background-image: linear-gradient(to top, red 50%, green 50%)
.
But It's covering the whole checkbox and add colours from top to bottom.
I want to apply only on the left side border only.
You may add a pseudo element to the td
and set its background-color
like this:
table {
border-collapse: collapse;
}
td {
position: relative;
border: 1px solid #ddd;
padding: 14px;
}
td:before {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 3px;
height: 100%;
background: -moz-linear-gradient(top, #009eff 50%, #dc3d4c 50%);
background: -webkit-linear-gradient(top, #009eff 50%,#dc3d4c 50%);
background: linear-gradient(to bottom, #009eff 50%,#dc3d4c 50%);
}
<table>
<tr>
<td><input type="checkbox"></td>
</tr>
<tr>
<td><input type="checkbox"></td>
</tr>
</table>