Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple HTML table/CSS font question

    I've got a site with a LOT of HTML tables (arguments against notwithstanding ) Due to requirements...all the tables are different shapes/sizes/colors etc. Now being a newb for the most part...I've ended up with every line of my HTML code for the tables having the font type and size contained within as such:

    Code:
    <tr> 
          <td width="40" bgcolor="#00CCFF"> <div align="center"><font size="3" face="Times New Roman">BLAH BLAH</font></div></td>
          <td width="431" bgcolor="#00CCFF"> <div align="left"><font size="3" face="Times New Roman">BLAH BLAH</font></div></td>
    </tr>
    Having been reading up on CSS...among other things...what is the simplest way to code a CSS page that will allow my tables to have the required font type/size without having it within the HTML code itself?

    If this question makes sense...I'd appreciate any/all responses.

    Thanks

  • #2
    Regular Coder medigerati's Avatar
    Join Date
    Jul 2005
    Location
    San Antonio, Tx
    Posts
    163
    Thanks
    0
    Thanked 7 Times in 7 Posts
    I think this should work:
    Code:
    td {
      font-size: 12px; // Or whatever size you need it to be...  12px != 3
      font-family: Times New Roman, serif;
    }
    If you need a little more help, I'm available as a Website designer in San Antonio
    ----------
    If I've helped, please check out my friend's nature photography and let me know if you like anything.

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually font-size: medium would be equivalent to "3" so...

    Code:
    td {
      font: medium "Times New Roman";
    }

  • #4
    Regular Coder medigerati's Avatar
    Join Date
    Jul 2005
    Location
    San Antonio, Tx
    Posts
    163
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Good point, that code is as simple as it gets!

    here's the code to embed it in your <head> tag:

    Code:
    <style type="text/css">
    td {
      font: medium "Times New Roman";
    }
    </style>
    If you need a little more help, I'm available as a Website designer in San Antonio
    ----------
    If I've helped, please check out my friend's nature photography and let me know if you like anything.


  •  

    Posting Permissions

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