Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:37:51+00:00 2026-06-18T06:37:51+00:00

Firstly, I have no control over the markup, I am merely styling this. I

  • 0

Firstly, I have no control over the markup, I am merely styling this.

I have a table with a series of rows, some rows have a class in consecutive order. I’ve been able to select the first element of the series but can’t manage to select the last.

Any ideas?

Here is an example:

<table>
    <tr class="parent">
        <td></td>
    </tr>
    <tr class="parent">
        <td></td>
    </tr>
    <tr class="child">
        <td></td>
    </tr>
    <tr class="child">
        <td></td>
    </tr>
    <tr class="parent">
        <td></td>
    </tr>
    <tr class="child">
        <td></td>
    </tr>
    <tr class="child">
        <td></td>
    </tr>
    <tr class="child">
        <td></td>
    </tr>
    <tr class="parent">
        <td></td>
    </tr>
</table>

the css I have for selecting the first element of each child series is:

table tr.parent + tr.child

I cannot use jQuery!!!! this has to be pure CSS!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:37:53+00:00Added an answer on June 18, 2026 at 6:37 am

    Use the :last-child selector. Example:

    table tr:last-child
    

    This will select every tr which is the last element in its parent; in this case, the last tr in the table. More about it: https://developer.mozilla.org/en-US/docs/CSS/:last-child

    The + is the adjacent child selector, and in your example will select any tr.parent which has tr.parent as a sibling immediately before it. More about it: https://developer.mozilla.org/en-US/docs/CSS/Adjacent_sibling_selectors

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What?! I know, what a bad idea. Firstly I have no control over the
Firstly, I do not have any malicious intent out of this question. I would
ok so i have code that fundementally has this structure: firstly a main div
Firstly: I am totally a newbie for this kind of work. I have a
Firstly, there have some tag links in my main page. click each one, post
firstly I have the following details in my database table field as 'company_name'=>'Test Company'
2 Questions, firstly I have this code: function Question(container, question_list, chosenAnswer) { this.container =
So I need to create a webpart. I'd like some control over the design
My first post - firstly have to say that this site is great -
Is it possible to do Virtual Machine(VM) provisioning? Firstly I have a some questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.