[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Different Formats For Tables

Posted on 2015-02-19
3
Medium Priority
?
69 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

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 44

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

650 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