I am attempting to select multiple elements of a table with a specific class. What is the correct way to do it as I do not believe I’ve done it right in the example below?
I want both the th’s and td’s of class .myTable to have the specified styles applied.
Keep in mind I may want to do something like this elsewhere, for instance, all of the p’s and spans of div with class .myDiv to have a background color of blue or something like that. So not a solution specific to tables.
.myTable th, td
{
border: 1px;
border-color: #D3D3D3;
text-align: left;
padding-left: 10px;
}
EDIT:
My apologies as I realize the question was not clear. In my situation, the elements th and td are children of a table with the class of .myTable. The th and td elements do not have any classes directly applied to them in my scenario.
You need this (add
.myTablebeforetdas well):