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 854481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:55:48+00:00 2026-05-15T07:55:48+00:00

I have a table with multiple tbody’s, each of which has a classed row,

  • 0

I have a table with multiple tbody’s, each of which has a classed row, and I want it so that the classed row in the first tbody has style differences, but am unable to get tbody:first-child to work in any browser. Perhaps I am missing something, or maybe there is a workaround.

Ideally, I would like to provide the programmers with a single tbody section they can use as a template, but will otherwise have to add a class to the first tbody, making for an extra test in the programming.

The html is straightforward:

<tbody class="subGroup">
    <tr class="subGroupHeader">
        <th colspan="8">All Grades: Special Education</th>
        <td class="grid" colspan="2"><!-- contains AMO line --></td>
        <td><!-- right 100 --></td>
    </tr>
    <tr>...</tr> <!-- several more rows of data -->
</tbody>

There are several tbody’s per table. I want to style the th and td’s within tr.subGroupHeader in the very first tbody differently than the rest. Just to illustrate, I want to add a border-top to the tr.subGroupHeader cells.

The tr.subGroupHeader will be styled with a border-top, such as:

table.databargraph.continued tr.subGroupHeader th, table.databargraph.continued  tr.subGroupHeader td {
    border-top: 6px solid red;
}

For the first tbody, I am trying:

table.databargraph.continued tbody:first-child tr.subGroupHeader th {
    border-top: 6px solid blue ;
}

However, this doesn’t seem to work in any browser (I’ve tested in Safari, Opera, Firefox, and PrinceXML, all on my Mac)

Curiously, the usually excellent Xyle Scope tool indicates that the blue border should be taking precedence, though it obviously is not. See the screenshot at http://s3.amazonaws.com/ember/kUD8DHrz06xowTBK3qpB2biPJrLWTZCP_o.png

This screenshot shows (top left) the American Indian th is selected, and (bottom right), shows (via black instead of gray text for the css declaration), that, indeed, the blue border should be given precedence. Yet the border is red.

I may be missing something fundamental, like pseudo-classes not working for tbodys at all… This really only needs to work in PrinceXML, and maybe Safari so I can see what I’m doing with webkit-based css tools.

Note I did try a selector like tr.subGroupHeader:first-child, but such tr’s apparently consider the tbody the parent (as I would suspect), thus made every border blue.

Thanks…

  • 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-05-15T07:55:49+00:00Added an answer on May 15, 2026 at 7:55 am

    Sorry folks, but I’m gonna answer my own question. But I do appreciate the help.

    Instead of:

    table.databargraph.continued tbody:first-child tr.subGroupHeader th {
        border-top: 6px solid blue ;
    }
    

    What I should have done was:

    table.databargraph.continued > tbody:first-of-type tr.subGroupHeader th {
        border-top: 2px solid blue !important ; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that has multiple payments occuring on different dates each month.
Ok, I have a table which contains multiple rows. Each row contains some data
I have multiple table rows that has a set of radio buttons on each
I have a table that contains multiple rows. Each row contains 5 columns (or
I have a generated table that contains multiple rows with each row containing a
I have a table with multiple rows. Each row is a form. I want
I have a table with multiple rows, each row has: layout (select) images *
I have a table with multiple rows. Each row has a check button. How
I have a table with multiple rows in each row is a select list
I have a table that has multiple rows with the following fields: PersonName SongName

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.