title: CSS selector last row from main table
body: <p>I have a table inside a table, and I want to fill the background of the last row of table 1 only — not table 2.</p>
  
  <pre><code>&lt;style&gt; 
  #test tr:last-child
  {
    background:#ff0000;
  }
  &lt;/style&gt;
  
  &lt;table border="1" width="100%" id="test"&gt;
  &lt;tr&gt;
   &lt;td&gt;
    &lt;table border="1" width="100%"&gt;
     &lt;tr&gt;
      &lt;td&gt;table 2&lt;/td&gt;
     &lt;/tr&gt;
    &lt;/table&gt;
   &lt;/td&gt;
  &lt;/tr&gt; 
  
  &lt;tr&gt;&lt;td&gt;table 1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;table 1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;table 1&lt;/td&gt;&lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>With my CSS, I'm coloring both last rows of table1 and table2.</p>