Search
 
SCRIPT & CODE EXAMPLE
 

CSS

select last tr in table css

Your tables should have as immediate children just tbody and thead elements, with the rows within*. So, amend the HTML to be:

<table border="1" width="100%" id="test">
  <tbody>
    <tr>
     <td>
      <table border="1" width="100%">
        <tbody>
          <tr>
            <td>table 2</td>
          </tr>
        </tbody>
      </table>
     </td>
    </tr> 
    <tr><td>table 1</td></tr>
    <tr><td>table 1</td></tr>
    <tr><td>table 1</td></tr>
  </tbody>
</table>


Then amend your selector slightly to this:

#test > tbody > tr:last-child { background:#ff0000; }
Comment

PREVIOUS NEXT
Code Example
Css :: multiple box shadows css 
Css :: css grid span all columns 
Css :: selenium find element by css selector 
Css :: centered navigation 
Css :: display sm none 
Css :: install wrangler 
Css :: website css not loading 
Css :: how to change border height in css 
Css :: css hide element 
Css :: rounded left border tailwind css 
Css :: css cut lines 
Css :: shrink a div by 50% 
Css :: can we block onclick of button using css 
Css :: css cursor size 
Css :: css example 
Css :: scroll design 
Css :: define element opacity css 
Css :: italic in css 
Css :: what is a max and min width media query 
Css :: css create sidebar 
Css :: Border property to set the LEFT border to "dotted" 
Css :: css grid column 
Css :: zoom background image css 
Css :: css transition on click 
Css :: crop image in div 
Css :: in a form how to remove the input outerline color or shadow 
Css :: CSS cloud shape 
Css :: scss darken 
Css :: execution timeout expired the timeout 
Css :: css make div one line 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =