Can someone help me with a CSS issue I'm facing? How do I ensure that the border style of a specific cell in a table overrides the surrounding cells?
The problem is illustrated in the image linked below. I am trying to make sure that the 'Today' cell has a solid black border on all sides, rather than just the bottom and right sides:
https://i.sstatic.net/paE5d.png
To see the issue in action, check out this JSFiddle here
CSS code example:
td {
border: 1px solid #ccc;
}
.event {
border: 2px solid gray !important;
}
.today {
border: 2px solid black !important;
}
Table HTML structure:
<table class="table">
<tr>
<td>Detail</td>
<td>Detail</td>
<td class="event">Event</td>
<td>Detail</td>
<td>Detail</td>
</tr>
<tr>
<td>Detail</td>
<td class="event">Event</td>
<td class="today">Today</td>
<td class="event">Event</td>
<td>Detail</td>
</tr>
<tr>
<td>Detail</td>
<td>Detail</td>
<td class="event">Event</td>
<td>Detail</td>
<td>Detail</td>
</tr>
</table>