Skip to main content
Known Participant
May 10, 2017
Answered

html code for font in Table

Using the latest version of DW on Mac. How can I insert HTML code into the Table code to set the font?

This topic is closed to new replies. Start a new post to keep the conversation going.
Nancy OShea
Nancy OSheaCorrect answer
Community Expert
May 10, 2017

You can legally use inline CSS in your HTML5 code but I don't normally do this except for HTML Emails.  It's kind of a mess when used in web sites.  But if you're using Muse, I don't imagine clean code is your biggest priority.

<table style="font-family:"Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; font-size: 15px; font-variant: small-caps; font-style: oblique; font-weight:bold">

For more Font-family options, consult CSS Font-stack.

CSS Font Stack: Web Safe and Web Font Family with HTML and CSS code.

For more on CSS Font Styles, consult W3Schools.

CSS Fonts

Nancy

Nancy O'Shea— Product User & Community Expert

4 replies

Jon Fritz
Community Expert
Community Expert
May 10, 2017

HTML <font> tags really aren't used for setting the font family anymore, DW now uses CSS for this...

1. Click the CSS button on the left of the Properties Window (Window > Properties or Ctrl + F3 if it's not open)

2. Click in the cell you want to change in Design View (switch to Design if you are in Live)

3. In the Properties window, choose a font-family or type the font you want to use in the Font field/dropdown

This will add inline css (a style attribute) with the font to your <td> tag.

Translate
craigstAuthor
Known Participant
May 10, 2017

I actually need the HTML code, not CSS, because I am using Muse HTML editor to insert a table.

I find creating and editing a table is easier in DW, then I copy the code and paste it into Muse.

So what I really need is the HTML5 code for fonts (family, size, style, etc).

Translate
Jon Fritz
Community Expert
Community Expert
May 10, 2017

The html <font> tag was removed from the HTML5 spec entirely, it's no longer valid to use <font> tags to specify color, family or size.

Using CSS in the style attribute is the HTML code for it, otherwise you would use either a link to an external .css file, or a <style> tag in the <head> of your page.

HTML font tag (Not Supported in HTML5)

Translate