JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr class="row">
<td>day 1</td>
<td>day 2</td>
<td>day 3</td>
<td>day 4</td>
<td class="today">day 5</td>
<td>day 6</td>
<td>day 7</td>
<td>day 8</td>
</tr>
</table>
CSS
td {
margin: 0;
padding: 10px;
border: 1px solid #ccc;
}
.selected {
background: blue;
color: white;
}
JavaScript
$('td').on('mouseenter', function(){
var todayIndex = $(this).siblings('.today').index(),
index = $(this).index(),
fromTo = index < todayIndex ? [index, todayIndex + 1] : [todayIndex, index + 1];
$("td")
.removeClass("selected")
.slice.apply($("td"), fromTo)
.addClass('selected');
});