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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:34:33+00:00 2026-05-26T08:34:33+00:00

I am new to HTML and CSS. I have added a CSS class to

  • 0

I am new to HTML and CSS.

I have added a CSS class to a table element. Then I added a child table into the parent table. The problem is that the parent tables CSS class also affects the child table.
I dont want this to happen.

How can I ensure that the CSS applied to the parent table does not affect the child table?

My Css is as Follows:

.gtable {
    width: 100%;
}
.gtable th {
    padding: 5px 10px;
    text-align: left;
}
.gtableTH {
    text-align: center;
}
.gtable thead tr {
    border: 1px solid #CCCCCC;
    color: #333333;
}
.gtable thead th {
    background: none repeat scroll 0 0 #C0C0C0;
}
.gtable tbody tr:hover td {
    background-color: #FFFAE3;
}
.gtable td {
    padding: 5px 10px;
}
.gtable tbody tr td {
    border-bottom: 1px solid #EEEEEE;
}
.gtable tbody tr:nth-child(2n+1) .gtable thead th {
    background: -moz-linear-gradient(#FFFFFF, #EFEFEF) repeat scroll 0 0 transparent;
}

and my HTML :

<table class="gtable">

                        <thead>

                            <tr>

                                <th>Drop Down Label</th>
                                <th>Drop Down Values</th>
                            </tr>

                        </thead>

                        <tbody class="ui-sortable">

                            <tr>

                                <td>Category 1</td>

                                <td>
                                    <table>
                                        <tbody class="ui-sortable"><tr>
                                            <td>
                                                Complaint
                                            </td>
                                            </tr>
                                            <tr>
                                            <td>
                                                Service Request
                                            </td>
                                            </tr>
                                            <tr>
                                            <td>
                                                Enquiry
                                            </td>
                                        </tr>
                                    </tbody></table>
                                </td>

                                <td>
                                     <button class="button small" type="submit">Edit</button>
                                </td>

                            </tr>

                        </tbody>
                    </table>
  • 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-26T08:34:34+00:00Added an answer on May 26, 2026 at 8:34 am

    no clue without your code, but here’s a demo of two tables with nested tables. one has the styles turned off: http://jsfiddle.net/jalbertbowdenii/7QWQv/

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

Sidebar

Related Questions

How to add new css class or id and then write properties for html
I have a button that, when pressed, will add a new HTML row. Within
I have several textboxes that are all of the same css class MyClass. I'm
I am working on a site (new to HTML/CSS). I have a main container
I am new to JavaScript and jQuery, but have used HTML and CSS before.
I have noticed recently, when I apply a template to a new HTML website,
I have an html table with a few rows, I have included a jquery
I have added some javascript in html page for input validation.same page is working
I'm completely new to HTML, CSS and Javascript but drawing on previous knowledge of
I have a database that has two tables, one of which contains a foreign

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.