Solved

How do I change a class in a <td>

Posted on 2014-07-27
4
110 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

687 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