#1
  1. No Profile Picture
    Off-topic
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2003
    Location
    Geneva / Genève / Genf / Ginevra
    Posts
    1,633
    Rep Power
    1365

    CSS in tables and how to!


    Hi everyone,

    Dont actually know if this is possible (my css knowledge is way not what it should be!)

    Can I define a whole set of attriblutes for a table (fonts, links, hover links etc etc) and than just use it with

    <table class = "whatever"> etc

    and then that table will have all the properties I defined (for only that table, not for the rest of the page)

    if so how could I go about doing that.

    Any help is very appreciated!

    cheers
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    178
    Rep Power
    12
    yes but really no...you can't apply a style to something unless you...

    A) apply a style OR
    B) style a tag

    B for instance could be

    td (
    stylestuffhere
    }

    and anything inside of td would have that style...so, you would stil need to apply a style unless you use you td tags for ONLY what you need...you'll still probably need...

    td class='stylee' or A

    i think what you had in mind was something like this...

    table.styleee tr.styleee td.styleee { }

    but this is really the same thing as A...

    good luck...v
  4. #3
  5. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    its possible

    <table class="test">

    css

    .test {
    /*style for the table*/

    }

    .test td {
    /*style for the td within the table test */
    }

    .test a{
    /*style for the link within the table test */
    }

    etc.
    vaaske you don't need to put classes on every td, just use the cascading in css

IMN logo majestic logo threadwatch logo seochat tools logo