I have a table
<table border="1">
<tr>
<td rowspan="2">September</td>
<td>Jim</td>
</tr>
<tr>
<td>Dave</td>
</tr>
<tr>
<td>October</td>
<td>Fred</td>
</tr>
</table>
using the code I am able to apply the class Red to the first row of the rowspan only, i.e, only Jim is being highlighed red and not Dave. I also want Dave to have the class Red…Please note I want to apply the class per row and not per cell.
var fullRowNumCells=1;
$('#table tr').each(function(){
if( $(this).find('td').length==fullRowNumCells){
if($.trim($(this).find('td:first').html()!=''))
{
$(this).addClass("red");
}
}
});
Keep it simple. For a table with n columns;
Sometimes it’s easier to think of what to take away then what to add http://jsfiddle.net/NV8uu/1/