Solved

Different Formats For Tables

Posted on 2015-02-19
3
52 Views
Last Modified: 2015-02-19
Hi Experts,

I have CSS written for table, tbody, thead, td, etc., which works the way I wanted. Here, I not using any classes or ids.

My question is how can I easily use 1 class for the table that will apply to all sub-elements like tbody, thead, etc., where if I create another table without any class, this CSS will not affect it?

Thank you,
0
Comment
Question by:APD_Toronto
  • 2
3 Comments
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 40619474
Use the class selector in your CSS for each of the elements you want to style

table { ... }
thead { ... }
td { ... }

.someTable { ... }
.someTable thead { ... }
.someTable td { ... }
0
 

Author Comment

by:APD_Toronto
ID: 40619485
Do I just assign class to the table element or to each thead, td?
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 40619496
You can assign it to the table. This CSS...

.someTable thead { ... }

...will style a thead inside of 'something' that has the .someTable class - that could be your table - it could even be a DIV.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Tool to Build Android and iOS App 3 51
Centering a nested div 16 55
CSS Question 9 41
How can i create a customized Login page based on Wordpress ? 8 26
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now