Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

<table> <thead> ... </thead>  <tbody>     <tr>         <td>Name</td>         <td><input type='text' id='txtName' /></td>     </tr> </tbody> </table> 

like image 688
uzay95 Avatar asked May 23 '09 10:05

uzay95


1 Answers

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.

like image 138
cletus Avatar answered Oct 01 '22 01:10

cletus