Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

html code for font in Table

Participant ,
May 10, 2017 May 10, 2017

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

3.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 10, 2017 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.

...
Translate
Community Expert ,
May 10, 2017 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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 10, 2017 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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2017 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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2017 May 10, 2017
LATEST

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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines