Solved

How do I change a class in a <td>

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

803 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