title: CSS - hide if has child with class
body: <p>I'm trying to make a print stylesheet which hides (does not print) elements which do not have a child element with a set class.</p>
  
  <p>I thought this might work but sadly it doesn't.</p>
  
  <pre><code>&lt;style type="text/css" media="print"&gt;
      table:not( &gt; thead &gt; tr &gt; th &gt; .Collapse)  {
          display:none;
      }
  &lt;/style&gt;
  </code></pre>
  
  <p>I don't want to use any javascript if possible though.</p>
  
  <p>Can this be done?</p>
  
  <p>Here's the html for the element in question... the second table should be hidden when printed...</p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  &lt;span class="Collapse"&gt;Lorem ipsum...&lt;/span&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody style="display: none; "&gt;
          &lt;tr&gt;
              &lt;td&gt;Blah Blah...&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  &lt;span class="Expand"&gt;Lorem ipsum...&lt;/span&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody style="display: none; "&gt;
          &lt;tr&gt;
              &lt;td&gt;Blah Blah...&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>