SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast joga2323's Avatar
    Join Date
    Oct 2001
    Location
    American in London
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS within tables

    Quick question:

    I am an html pro who is used to putting a zillion font tags in tables. I'm fairly new to CSS however and was wondering if it is ok to do this:

    <table CLASS="BodyText">

    whereas I wouldn't have to put the tag in each and every table cell as I used to with html.

    TIA,
    lysa

  2. #2
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm I don't know if it will work try!!! also check this out


    http://wdvl.com/Authoring/Style/Sheets/NavMar.html

    There you can see that you can use TH or TD in your CSS file and thus make some style
    the neigbours (free) WIFI makes it just a little more fun

  3. #3
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My best advice to you on issues such as this one is "Just try it!"

    Create a simple html doc with one table and try and apply your bodytext class to it!

    If anything else it is good practice especially if you are new to CSS

  4. #4
    SitePoint Addict
    Join Date
    Jul 2001
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may have better luck putting the CLASS into the TD tag in some cases. Some picky browsers such as Netscape4 may prove this. Then again, maybe not.

    Give it a go, see how it works

  5. #5
    SitePoint Enthusiast joga2323's Avatar
    Join Date
    Oct 2001
    Location
    American in London
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have answered my own question by trying it. you're right--explorer reads it right but netscape doesn't. (I thought that I tried it before I posted but I must have not refreshed the page or something or maybe I failed to look at it in netscape...) I've just put it in my <td>s but it's still less code than HTML!

    I really like CSS but I'm not quite ready to give up my spacer.gifs and table cells.

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to assign a font style to page elements then it would be simpler to do this:

    <style type="text/css">
    <!--

    body, p, td, div { font-family: verdana; font-size: 12pt; }

    -->
    </style>

    Doing it this way will cover every commonly used container element used in websites. If you need something to be a different size, you can then use <smaller> and <larger> tags. This way text will be proportionate to the users browser settings.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    SitePoint Enthusiast joga2323's Avatar
    Join Date
    Oct 2001
    Location
    American in London
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sounds good! thanks, creole.

  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way Joga...

    That methoed will work all the way back to Netscape 4.x.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  9. #9
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    joga2323, if you want to specify the class in your table tag instead of td tags, try this:

    Code:
    table.myclass td { font-family: verdana; font-size: 12pt; }
    Note the lack of a comma between table and td.


Bookmarks

Posting Permissions

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