Solved

How do I change a class in a <td>

Posted on 2014-07-27
4
103 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 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

15 Experts available now in Live!

Get 1:1 Help Now