I have been able to select the specific rows that I wanted but I can’t select specific td from those tr.
I used this to select rows:
$('#time-slot tr:not(:first, :last)')
then within those selected rows I was trying to ignore the first and the last td but it is not working. I used similar approach as above
$('#time-slot tr:not(:first, :last) td:not(:first, :last)')
Any ideas how should I approach this problem. Btw I am trying to click and drag the mouse to paint the cells with user defined color.
I prefer using less of a string selector and more of the jQuery methods, as well as using the
:first-childand:last-childselectors for your problem:http://jsfiddle.net/7b4Ms/
Depending on what you are expecting, which you haven’t explained very well, this may or may not be what you want. What this does is select all
trelements that are not the first and last. Inside of those matchedtrelements, it selects alltdelements that are not first and last. So basically, it doesn’t select the outside ring of cells in thetable.