Hemlock Posted September 25, 2009 Share Posted September 25, 2009 Would there be an alternative option to style multiple td's within an TR (not all but a couple) say for example the first 3 TD's in the code below other then assigning a class to each TD. <tr> <td>data</td> <td>data</td> <td>data</td> <td>data</td> <td>data</td> <td>data</td> <td>data</td> </tr> Cheers in advance Link to comment Share on other sites More sharing options...
thescientist Posted September 25, 2009 Share Posted September 25, 2009 classes should work.CSS.special_td{...}HTML<td class="special_td">...</td> Link to comment Share on other sites More sharing options...
jeffman Posted September 25, 2009 Share Posted September 25, 2009 What you're looking for is some combination of child and sibling selectors. Unfortunately, the CSS specification is not as detailed as you would need for this, and sibling selectors aren't supported at all in IE6-7. So you're pretty much left with classes.If you're asking because you have a lot of tables or rows like this and want to simplify the process, then PHP might offer an automated solution. But if you don't already know PHP, this task may not be sufficient reason to go out and learn it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.