I am attempting to replicate the functionality of the table-hover
class on a Bootstrap table that contains multiple cells with different rowspan
values. This means I want to highlight every cell within the same row. Below is an example demonstrating the current behavior of the table-hover
class:
.td-centered {
vertical-align: middle!important;
text-align: center;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<table class="table text-center text-nowrap table-bordered table-hover">
<thead>
<tr>
<th scope="col" class="h5 font-weight-bold">
Date
</th>
[......]
The desired behavior is depicted below:
.td-centered {
text-align: center;
vertical-align: middle !important;
}
.red-bg {
background-color: red;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<table class="table text-center text-nowrap table-bordered">
<thead>
<tr>
<th scope="col" class="h5 font-weight-bold">
Date
</th>
[...]
</tbody>
</table>
To achieve this, jQuery may be necessary. While utilizing only Bootstrap for the solution is preferable, standard CSS can also be used. Any assistance or insight you can provide would be greatly appreciated :)