For certain table cells i would like to have a multi colored top-border or bottom-border.
Based on how-to-create-multi-color-border-with-css and css-multi-color-border i was able to create a multi color border.
The problem is that i want to combine it for a table cell td
where some cells have a normal border and others have a multi color border.
This code below sets the multi color for a cell but as soon as a i want to add black borders for "normal" cells it overwrites the multi color border (see codepen)
<style>
.works .gap-from {
text-align:center;
border-bottom: 4px solid;
border-image: linear-gradient(to right, lightgrey 40%, yellow 40%) 1;
}
</style>
<table class="works">
<tr><td>no color border</td><td class="gap-from">without span</td></tr>
<tr><td><span class="gap-from">with span</span></td></tr>
</table>
It seems to make it partly work a background color must be set for the table. But this leads to thick border lines.
table.works {background-color: black;}
table.works colgroup {background-color: white;}
FYI: the purpose is to visualize date overlaps and date gaps.
Question
What can be done to have
- normal thin borders for every cell
- multi color borders for certain cells
- without using additional markup (an additional span)?