Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Sep 2003
    Location
    Texas, USA
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting fonts in a table

    I am trying to set a font size and type in tables and am having no success. The text in my webpage disappears or changes color. I am adding <font face="arial" color="#212121"> after <TD> or <TH>, according to an HTML primer I have. I have inserted this html language in other parts of the table and nothing works. HELP!
    Attached Files Attached Files

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    You might consider using CSS (Cascading Style Sheets) to help you with this formatting issue.

    You can add the following in the Head section of your page:

    <style type="text/css">

    .YourStyleName { font-family: Arial; color: #212121; }

    </style>

    Then add class="YourStyleName" to your TD tag. This will replace the need for the separate Font tag.

    Also, you can place this once in the Table tag and it will apply to the entire table.

    Hope this helps!

  3. #3
    Star Lounger
    Join Date
    Sep 2003
    Location
    Texas, USA
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    Thank you. I appreciate your help, but I have not yet tackled CSS. I will. Just not yet. In the meantime, I hope to find out why the font tag does not work in the tables. Since it is inside the table, would I also have to put the closing </font>? Many thanks!

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    CSS is likely the easiest way to deal with this. You're likely to have several problems with varying fonts throughout your table otherwise.

    Your font tags should only surround the text effected (e.g. should not span table tags), and should always open and close.

    I hope this helps!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  5. #5
    Star Lounger
    Join Date
    Sep 2003
    Location
    Texas, USA
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    Attached is a file in which I tried to use CSS. I did something wrong. Help! Thank you! <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Attached Files Attached Files

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    What is the result you're expecting?

    #212121 returns black, and the entire file appears to be in Arial...
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  7. #7
    Star Lounger
    Join Date
    Sep 2003
    Location
    Texas, USA
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    Do I have to specify font size for text in a table? I assume <table> negates instructions for font attributes given elsewhere in the document?

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    As long as the whole document is defined within a <font> tag, it *should* retain the font settings universally...

    CSS would be useful here if you wanted to display alternating row colors inside of your table, or use a different font for your table contents. The results you're getting here are exactly what you'd expect, as near as I can tell. Unless i'm missing something? Are you trying to do something completely different inside of your tables?
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  9. #9
    Star Lounger
    Join Date
    Sep 2003
    Location
    Texas, USA
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    I'm trying to make the text in the tables the same size as the font outside of the tables. No matter what I try, the table font is much larger.

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting fonts in a table

    add a font-size attribute to your stylesheet definition:
    <pre>table { font-family: Arial, Helvetica, sans-serif; font-size: 12px}</pre>

    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Setting fonts in a table

    It's probably safest to drill down to the specific enclosing elements you want this to apply to, the <BODY></BODY>,

    </P>, and <TD></TD> tag pairs:

    <style type="text/css">
    body, p, td { font-family: Arial; color: #212121; font-size: medium }
    </style>

    On that last parameter you have zillions of options...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •