Solved

Different Formats For Tables

Posted on 2015-02-19
3
50 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 42

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 42

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

743 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