Hi folks.  

Short version:  IS there a Selector construction that would allow me to
affect a parent element based upon a contained (child) element?  I want to
DISPLAY:NONE for a whole table row <TR>, if any of the cells have the STRIKE
tag internally.  I want to affect the PARENT of the child, not the other way
around.  I've been researching "complex selectors" but I haven't come up w/
anything.


Long version (w/ example follows): 

I have an off the wall requirement.  I have an app that uses the IE
rendering engine to show items from a PIM list (http://essentialpim.com).
Shown on the main display are:  Schedules for the day, To-Do List, and
Birthdays from a contact db.

It looks good, and works pretty well for me, with one exception... the To-Do
list shows everything, pending and completed tasks.  I want to KEEP all the
completed tasks, I just don't want them to show (or to be able to alternate
showing one, the other, or both).

Completed items use an embedded < STRIKE > tag to indicate that they are
done.  The programmers haven't making a very good use of CSS right now, but
I am encouraging them.  

I know part of the code that that displays the To-Do list in tables, and I
have an "almost workaround" -- meaning, it almost works.  My downfall is the
selectors.

Using a copy of the page source, I play around adding a display class to
every TR element that contained "STRIKE" internally (I used an editor to
insert my own classes, it's not real-time).  I can then set the DISPLAY on
the class to NONE, and because the class is in the TR, the whole row
disappears, and the table collapses to just show my remaining (in-complted)
tasks.  Perrrrfect.  Except, I can't (won't) hack his code to make it add
the CSS, class, attribute, and tags.

I had a brain shower and defined a user style sheet attached to IE.  In the
CSS, I set 
  TR STRIKE {Display:None;} 

Shazaam!  The text spanned by STRIKE tags disappears.  

But, because the whole structure includes table elements that don't contain
STRIKE, I get large blank spaces, with my in-completes sprinkled through the
remaining table structure.

Is there ANY arrangement of CSS Selectors that will allow me to affect the
display of the whole TR _if_ the tag STRIKE shows up somewhere inside it?

Typical rows would be (additional code excised for your protection): 

<!-- Completed task example --> 
      <tr align="center"> 
        <td width="18"> 
          <img src="img024.bmp"> 
        </td> 
        <td width="18"> 
          <img src="img026.bmp"> 
        </td> 
        <td width="18"> 
        </td> 
        <td width="120"> 
          <font color="#808080"><strike>5/22/2003 5:11:05 
          PM</strike></font> 
        </td> 
        <td width="120"> 
          <font color="#808080"><strike>5/21/2003</strike></font> 
        </td> 
        <td align="left"> 
          <font color="#808080"><strike>This is a completed
Task.</strike></font><br> 
        </td> 
        <td width="55" align="right"> 
          <font color="#808080"><strike>100%</strike></font> 
        </td> 
      </tr> 

<!-- Remaining task example --> 
      <tr align="center"> 
        <td width="18"> 
          <img src="img023.bmp" widht="12" height="12"> 
        </td> 
        <td width="18"> 
          <img src="img026.bmp" widht="12" height="12"> 
        </td> 
        <td width="18"> 
        </td> 
        <td width="120"> 
          5/5/2005 12:48:46 AM 
        </td> 
        <td width="120"> 
          5/16/2005 
        </td> 
        <td align="left"> 
          I still have to do this!  
        </td> 
      </tr> 




I can ONLY affect the CSS in MY USER STYLE SHEET.  I won't hack his code
(un-ethical), and I can't add JS or ASP or etc. to re-format the display w/
the added class on the fly.  

Any ideas?

  
Tnx,

Marc
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to