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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:05:33+00:00 2026-06-13T02:05:33+00:00

I am attempting to select multiple elements of a table with a specific class.

  • 0

I am attempting to select multiple elements of a table with a specific class. What is the correct way to do it as I do not believe I’ve done it right in the example below?
I want both the th’s and td’s of class .myTable to have the specified styles applied.

Keep in mind I may want to do something like this elsewhere, for instance, all of the p’s and spans of div with class .myDiv to have a background color of blue or something like that. So not a solution specific to tables.

.myTable th, td
{
    border: 1px;
    border-color: #D3D3D3;
    text-align: left;
    padding-left: 10px;
}

EDIT:
My apologies as I realize the question was not clear. In my situation, the elements th and td are children of a table with the class of .myTable. The th and td elements do not have any classes directly applied to them in my scenario.

  • 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-13T02:05:34+00:00Added an answer on June 13, 2026 at 2:05 am

    You need this (add .myTable before td as well):

    .myTable th, .myTable td
    {
        border: 1px;
        border-color: #D3D3D3;
        text-align: left;
        padding-left: 10px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to select all a hrefs that do not have the class
I'm attempting to use multiple ANDs in this query below, and it messes up
I'm attempting to gather/select data from a MySQL table to check it against new
I'm attempting to write a simple Select method on a class that inherits from
I have 30 rows in uitable view and I am attempting to select multiple
I'm creating a small forum. Attempting to run SElECT... JOIN... query too pick up
I am attempting to have mechanize select a form from a page, but the
Attempting to use the data series from this example no longer passes the JSONLint
I am attempting to run a JUnit Test from a Java Class with: JUnitCore
I'm attempting to select all <script type=text/html> tags in a page. I use <script>

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.