Solved

Different Formats For Tables

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
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 …
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

828 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