[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Different Formats For Tables

Posted on 2015-02-19
3
Medium Priority
?
71 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 45

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 45

Accepted Solution

by:
Chris Stanyon earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

834 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