How can I highlight all the cells or add some class to change background color, before a particular cell (with class) in table:
So, as per above table, I'm getting cell with red background as td>class=redCell. Now I want all cells before this cell to be red and all cell to be gray after this cell. How can I achieve this using jQuery/JS/CSS?
P.S. : I'm using VueJS, if it gives soultion easily. Fiddle My Code:
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Instance</th>
<th v-for="(items, index) in tableHeaders" v-if="items.type != 'start' && items.type != 'endevent' && items.type != 'intermediatethrowevent'"><span>{{items.name}}</span></th>
</tr>
</thead>
<tbody>
<tr v-for="(items, index) in tableData">
<td>{{items.id}}</td>
<td v-for="(headerItem, headerIndex) in tableHeaders" v-if="headerItem.type != 'start' && headerItem.type != 'endevent' && headerItem.type != 'intermediatethrowevent'" :class=" { redCell : (items.currentStatus == headerItem.id) }">
</td>
</tr>
</tbody>
</table>