I'm appending a row to a table. How can I change the background color in that row for a group of cells. Say column has 25 columns; columns starting from 17 till 22 needs a background color change.
This is what I tried so far:
$("#table1").append(row1);
$(row1).children('td')
.not('td:eq(0)')
.not('td:eq(0)')
.css({ "background-color": workcolor });
Here I use Childeren 'td' which all cells in row got colored instead I need a particular cells background need to changed as per ID of column.
I added my Html code You can clarify this:
<table class="table table-striped" id="table1">
<thead>
<tr>
<th class="" id="profilepic">Image</th>
<th id="empName">Employee</th>
<th id="0">00:00</th>
<th id="1">01:00</th>
<th id="2">02:00</th>
<th id="3">03:00</th>
<th id="4">04:00</th>
<th id="5">05:00</th>
<th id="6">06:00</th>
<th id="7">07:00</th>
<th id="8">08:00</th>
<th id="9">09:00</th>
<th id="10">10:00</th>
<th id="11">11:00</th>
<th id="12">12:00</th>
<th id="13">13:00</th>
<th id="14">14:00</th>
<th id="15">15:00</th>
<th id="16">16:00</th>
<th id="17">17:00</th>
<th id="18">18:00</th>
<th id="19">19:00</th>
<th id="20">20:00</th>
<th id="21">21:00</th>
<th id="22">22:00</th>
<th id="23">23:00</th>
</tr>
</thead>
<tbody id="body1">
<!-- appending rows goes here !-->
</tbody>
</table>