Css – How to select second td in detailsview datarow


I am trying create a new css for shaping my detailsview. But i couldn't reach to second td in detailsviews field rows. do you have any idea to access 2nd td?

But please imagine belov code generated by detailsview.


        <td><input type='text' id='txtName' /></td>

Best Answer

The first question is: do you need to support IE6? If the answer is yes then you can't do it. If not the easiest solution is probably:

td + td { ... }

Even more modern (and less supported) is:

td:nth-child(2) { ... }

This presupposes that you're not willing or not able to put a class or other identifier on the second td so you can do it much more easily.