Using CSS selectors to access specific table rows with selenium
You can use nth-child selector:
#items tr:nth-child(4) {color:#F00;}
Live example: https://jsfiddle.net/7ow15mv2/1/
But no idea if it works with Selenium.
But according to docs it should.
Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after).
you can try this for searching by any inner text
css=td:contains('Item 4')
found this helpful: http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/
Do you want to select by content ("Item 4")? By Position (the 4st row)? Or is <tr id="foo">
and selecting tr#foo>tdan option?