?
Solved

:first-child not working in IE??

Posted on 2005-04-18
8
Medium Priority
?
1,130 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:broesi
  • 4
  • 2
  • 2
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13804902
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13804921
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
 
LVL 5

Author Comment

by:broesi
ID: 13804960
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1000 total points
ID: 13805028
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
 
LVL 5

Assisted Solution

by:dougday
dougday earned 1000 total points
ID: 13808506
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
 
LVL 5

Author Comment

by:broesi
ID: 13821969
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13822780
Glad we could help.  Thanks for the A. :^)

Cd&
0
 
LVL 5

Expert Comment

by:dougday
ID: 13823658
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Suggested Courses
Course of the Month16 days, 2 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question