Solved

How do I change a class in a <td>

Posted on 2014-07-27
4
104 Views
Last Modified: 2014-08-13
I have a table that looks like this:

Address
Building Name
Crossing Streets

<td = class="Body_Labels"

I want to change the font for "Building Name" and "Crossing Street".
0
Comment
Question by:breeze351
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40222998
...
<td class="Body_Labels">
Address
<span class="sub_labels">
 Building Name
 Crossing Streets
</span>
</td>
...
<style>
.sub_labels {
font:arial
}
</style>

Open in new window

0
 
LVL 15

Expert Comment

by:Ess Kay
ID: 40223038
you can use span or div tags inside your code,  and give them a class
0
 
LVL 3

Expert Comment

by:Conner Turner
ID: 40223084
Hi breeze351,

This is very simple you just need to define some CSS for your class.

You can either wrap the whole section in a <div class="font"> and assign the font to the div by doing the following into your HTML code:

<style>
div.font {
    font-family: 'Tahoma';
}
</style>

Open in new window


Within this example I have used Tahoma as an example font, you would want to replace this with the name of your font that you wish for the table to be displayed in.

The other way you can do this is by assigning both <td> which contain the "Building Name" and "Crossing Streets" a class which they both share

<td class="Body_Labels">
Address
<span class="font_custom">Building Name</span>
<span class="font_custom">Crossing Streets</span>
</td>
...
<style>
span.font_custom {
    font-family: 'Tahoma';
}
</style>

Open in new window


Again this method allows you to take out and implement each sub level with a different font if needed at a later stage, as with the previous example I have used Tahoma as a font, you will need to change this to the font that is required.

HTH,
C
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

911 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

23 Experts available now in Live!

Get 1:1 Help Now