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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:14:06+00:00 2026-05-26T16:14:06+00:00

I have following html <table> <th>Name</th><th>age</th> <tbody> <tr><td>A</td><td>25</td></tr> <tr><td>B</td><td>30</td></tr> <tr><td>C</td><td>34</td></tr> <tr><td>D</td><td>32</td></tr> </tbody> </table> I

  • 0

I have following html

<table>
    <th>Name</th><th>age</th>
    <tbody>
        <tr><td>A</td><td>25</td></tr>
        <tr><td>B</td><td>30</td></tr>
        <tr><td>C</td><td>34</td></tr>
        <tr><td>D</td><td>32</td></tr>
    </tbody>
</table>

I want to select all tr inside tbody. Hence I used:

$('table tbody tr').css('background-color','yellow');

Highlight all TRs inside TBODY inside Table with yellow.
This shouldn’t select TH row, but it strangely does and highlights it yellow. Any thoughts!
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-26T16:14:07+00:00Added an answer on May 26, 2026 at 4:14 pm

    Your markup isn’t 100% valid so the browser is fixing it for you. See the spec for the allowed <table> structure.

    Wrap the <th> elements in a <thead>.

    <table>
        <thead>
            <th>Name</th><th>age</th>
        </thead>
        <tbody>
            <tr><td>A</td><td>25</td></tr>
            <tr><td>B</td><td>30</td></tr>
            <tr><td>C</td><td>34</td></tr>
            <tr><td>D</td><td>32</td></tr>
        </tbody>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <div style=30px;> <table width=100%;> <tr> <td> <SELECT name=guidelinks> <OPTION
I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
I have the following HTML: <table> <thead> <tr> <th>Id</th> <th>Name</th> <th>Description</th> <th>Actions</th> </tr> </thead>
I have mysql table with following fields id (which auto increments) title,name,age,institution,iod the fields
I have the following HTML markup: <table> <tr> <th><label>Item Name</label></th> <th><label>Quantity</label></th> </tr> <tr> <td><input
I have the following HTML table. I need to give a background color to
I have following generrated HTML, and I want to add some CSS class to
anyway what i want to do is: i have the following html: <table> <tr
I have the following html table <table id={64ED3A94-5833-4CC7-869F-CCE583B498BE} class=ms-listviewtable width=100% cellspacing=0 cellpadding=1 border=0 xmlns:o=urn:schemas-microsoft-com:office:office
I have the following HTML table: <table style=width: 100%;> <tr> <td class=title_bar_left_border></td> <td class=title_bar_middle></td>

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.