Newbie question about CSS - can you apply a style to an entire table or only to a <TD> cell

Discussion in 'HTML' started by Shiperton Henethe, Sep 19, 2003.

  1. A newbie question about CSS:

    Is it possible to set a style once and
    then have it apply the an entire table of data?

    Or do you have to keep resetting it on
    every <TD> ?

    Ship
     
    Shiperton Henethe, Sep 19, 2003
    #1
    1. Advertising

  2. Shiperton Henethe

    rf Guest

    "Shiperton Henethe" <> wrote in message
    news:3f6a39a0$0$24108$...
    >
    > A newbie question about CSS:
    >
    > Is it possible to set a style once and
    > then have it apply the an entire table of data?


    Yes.

    > Or do you have to keep resetting it on
    > every <TD> ?


    No.

    td {properties...}

    <table>
    <tr>
    <td>
    ....

    of if you wish to restrict it to this specific table:

    ..this td {properties...}

    <table class="this">
    <tr>
    <td>
    ....
     
    rf, Sep 19, 2003
    #2
    1. Advertising

  3. Shiperton Henethe

    brucie Guest

    In post <3f6a39a0$0$24108$>
    Shiperton Henethe said...

    > Is it possible to set a style once and
    > then have it apply the an entire table of data?
    >
    > Or do you have to keep resetting it on
    > every <TD> ?


    table td{... }

    http://www.w3.org/TR/REC-CSS2/selector.html#q1
     
    brucie, Sep 19, 2003
    #3
  4. Shiperton Henethe

    rf Guest

    "brucie" <-html.org> wrote in message
    news:83seeh1089sd$...

    Yo brucie. Welcome back mate.

    > In post <3f6a39a0$0$24108$>
    > Shiperton Henethe said...
    >
    > > Is it possible to set a style once and
    > > then have it apply the an entire table of data?

    >
    > table td{... }


    Isn't the table bit a little superfluous considering the only place a <td>
    can be is somewhere inside a <table>?

    Small picky point I know but is looking to become a slow day :)

    Cheers
    Richard.
     
    rf, Sep 19, 2003
    #4
  5. "brucie" <-html.org> wrote in message
    news:83seeh1089sd$...
    > In post <3f6a39a0$0$24108$>
    > Shiperton Henethe said...
    >
    > > Is it possible to set a style once and
    > > then have it apply the an entire table of data?
    > >
    > > Or do you have to keep resetting it on
    > > every <TD> ?

    >
    > table td{... }
    >
    > http://www.w3.org/TR/REC-CSS2/selector.html#q1


    I am a total newbie!
    The aweful thing is that I've clean forgotten
    everything I ever knew about CSS.

    I need a special file with all my CSS definitions
    in, right? And then I need some code somewhere in
    my HTML page that includes this CSS definitions
    page... (??)

    So in this CSS definitions file need something
    like:

    table td{ font-family: sans-serif }

    And then *all* references to <TD> contents in the page will
    have sans-serif applied to them?

    Am I close...?

    * * *

    - Can you recommend a very basic idiot's guide
    to CSS. I am drowning in details!

    Ship
     
    Shiperton Henethe, Sep 19, 2003
    #5
  6. Shiperton Henethe

    Adrienne Guest

    Gazing into my crystal ball I observed "Shiperton Henethe"
    <> writing in news:3f6a3ea0$0$10784$afc38c87
    @news.easynet.co.uk:

    >
    > "brucie" <-html.org> wrote in message
    > news:83seeh1089sd$...
    >> In post <3f6a39a0$0$24108$>
    >> Shiperton Henethe said...
    >>
    >> > Is it possible to set a style once and
    >> > then have it apply the an entire table of data?
    >> >
    >> > Or do you have to keep resetting it on every <TD> ?

    >>
    >> table td{... }
    >>
    >> http://www.w3.org/TR/REC-CSS2/selector.html#q1

    >
    > I am a total newbie!
    > The aweful thing is that I've clean forgotten
    > everything I ever knew about CSS.
    >
    > I need a special file with all my CSS definitions
    > in, right? And then I need some code somewhere in
    > my HTML page that includes this CSS definitions
    > page... (??)


    <head>
    <title>My CSS Page</title>
    <link type="text/css" rel="stylesheet" ref="styles.css">
    <style type="text/css">
    <!--
    /* this will over-ride the external styles.css sheet */
    body {
    background-color:#fff;
    color:#000
    }
    -->
    </style>
    </head>

    >
    > So in this CSS definitions file need something
    > like:
    >
    > table td{ font-family: sans-serif }
    >
    > And then *all* references to <TD> contents in the page will
    > have sans-serif applied to them?
    >
    > Am I close...?
    >
    > * * *
    >
    > - Can you recommend a very basic idiot's guide
    > to CSS. I am drowning in details!
    >


    http://www.w3schools.com/css/default.asp

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
     
    Adrienne, Sep 19, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: How to apply CSS to entire application?

    Kevin Spencer, Oct 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    392
    Jerry III
    Oct 15, 2003
  2. Richard Dixson
    Replies:
    1
    Views:
    528
    Joe Fallon
    May 18, 2004
  3. Richard Dixson
    Replies:
    2
    Views:
    747
    Richard Dixson
    May 18, 2004
  4. Water Cooler v2
    Replies:
    3
    Views:
    37,048
    Water Cooler v2
    Jul 12, 2006
  5. iwasjoeking
    Replies:
    2
    Views:
    149
    iwasjoeking
    Jun 7, 2007
Loading...

Share This Page