:first-child not working in IE??

Hello Experts,

I am trying to apply a different format to all <td>'s within the first <tr> within a <table> using CSS. It works fine using the :first-child pseudo thingy - but obviously not in IE!
Is there a workaround to make it work there, too?

broesi
LVL 5
broesiAsked:
Who is Participating?
 
COBOLdinosaurCommented:
If you do not have control of the code then you cannot modify it with CSS.  But it could be modified with scripting.  

Show me what the code looks like and I will give scripting to modify the presentation.

Cd&

0
 
COBOLdinosaurCommented:
You could try defining a col or colgroup for the first column an then apply the class to the col:
<table>
 <colgroup>
   <col class="yourclass">
</colgroup>
<tr>
<td>This should be styled</>
<td>regular column</td>
<td>regular column</td>
<td>regular column</td>
</tr><tr>
<td>This should be styled</>
<td>regular column</td>
<td>regular column</td>
<td>regular column</td>
</tr><tr>
<td>This should be styled</>
<td>regular column</td>
<td>regular column</td>
<td>regular column</td>
</tr>
</table>

Cd&


0
 
COBOLdinosaurCommented:
The other alternative is to script it.  

If the content is something other than tabular data you should be using proper layout elements instead of the table, then it becomes a lot easier.  For tabular data we are pretty much stuck with IEs lack of standards support.

Cd&
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
broesiAuthor Commented:
Basically, what I want to to is to have a line above and below the first ROW of the table. It is a table containing technical data. The table is created by a CMS. Unfortunately, the CMS does not include any class names within the HTML-tags...

How would I script it - JS?

broesi
0
 
dougdayCommented:
This question is also being discussed here:  http://www.experts-exchange.com/Web/Web_Languages/CSS/Q_21392449.html
I posted a javascript to accomplish this on that question. Maybe it will save people some time.
-Doug
0
 
broesiAuthor Commented:
Unfortunately, JS scripting is not an option here. Now that I know it can't be done with CSS, I can look for other ways. Thanks for your help!

broesi
0
 
COBOLdinosaurCommented:
Glad we could help.  Thanks for the A. :^)

Cd&
0
 
dougdayCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.