Styling a table

Discussion in 'HTML' started by ={ Advocated }=, Sep 15, 2003.

  1. Hey there, i have say 20 cells in a table, say 15 of them are all one
    background colour, and the other 5 arent.. I want to use css for this, so
    how would i go about it?

    Cheers
    ={ Advocated }=, Sep 15, 2003
    #1
    1. Advertising

  2. ={ Advocated }=

    andy johnson Guest

    On Mon, 15 Sep 2003 02:12:09 +0100, "={ Advocated }="
    <> wrote:

    >Hey there, i have say 20 cells in a table, say 15 of them are all one
    >background colour, and the other 5 arent.. I want to use css for this, so
    >how would i go about it?
    >
    >Cheers
    >

    Try in stylesheet:
    td {background-color:#EEEEFF; border: thin solid black; }
    ..teedee {background-color:#EECCFF; border: thin solid black; }


    <td>&nbsp;</td>
    <td class="teedee">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td class="teedee">&nbsp;</td>

    http://www.echoecho.com/csscolors.htm has something on this, among
    others.

    -
    Andy

    "There would be a lot more civility in this world if people
    didn't take that as an invitation to walk all over you"
    - (Calvin and Hobbes)
    andy johnson, Sep 15, 2003
    #2
    1. Advertising

  3. ={ Advocated }=

    Nico Schuyt Guest

    Nico Schuyt, Sep 15, 2003
    #3
  4. "Nico Schuyt" <> wrote in message
    news:3f657e84$0$28894$...
    > ={ Advocated }= wrote:
    > > Hey there, i have say 20 cells in a table, say 15 of them are all one
    > > background colour, and the other 5 arent.. I want to use css for
    > > this, so how would i go about it?

    >
    > Look at the example Els made for you:
    > http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    > (and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)
    > Regards, Nico
    >
    >



    This is what ive done now so far:
    http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm

    It doesnt look very pretty at the moment, the sides also seem to have monged
    since ive uploaded..

    Anyway, i havent put all sizes etc into css yet, i will once i have an idea
    of what it will look like.

    The cells with the certain px in are the ones that need to be that size, but
    im not sure what to put in all the others?

    Any ideas? See the one at the bottom, the copyright thing, would it be best
    to set that to 100% ? or would that not work, because then im thinking it
    would stretch to the bottom of the browser.. Any help would be apreciated
    ={ Advocated }=, Sep 15, 2003
    #4
  5. ={ Advocated }=

    Els Guest

    ={ Advocated }= wrote:

    > "Nico Schuyt" <> wrote in message
    > news:3f657e84$0$28894$...
    >
    >>={ Advocated }= wrote:
    >>
    >>>Hey there, i have say 20 cells in a table, say 15 of them are all one
    >>>background colour, and the other 5 arent.. I want to use css for
    >>>this, so how would i go about it?

    >>
    >>Look at the example Els made for you:
    >>http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    >>(and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)
    >>Regards, Nico

    >
    > This is what ive done now so far:
    > http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm
    >
    > It doesnt look very pretty at the moment, the sides also seem to have monged
    > since ive uploaded..
    >
    > Anyway, i havent put all sizes etc into css yet, i will once i have an idea
    > of what it will look like.


    I still think it's better to do that now, because right now
    the page doesn't validate. And what doesn't validate, might
    have a 'different' effect in different browsers, which will
    have you redoing loads of stuff again, after you got it the
    way you wanted it.

    > The cells with the certain px in are the ones that need to be that size, but
    > im not sure what to put in all the others?


    Let them size with the content?

    > Any ideas? See the one at the bottom, the copyright thing, would it be best
    > to set that to 100% ? or would that not work, because then im thinking it
    > would stretch to the bottom of the browser.. Any help would be apreciated


    100% of what? No, give it a height, or better, let it be the
    height the text in the footer needs (my opinion), and let
    the rest of the page free. If you want the footer at the
    bottom of the window, a seperate div for the footer might do
    what you want, which I think is easier to accomplish with
    Nico's structure than with the table. But keep in mind, that
    if there isn't much content, people don't like to scroll all
    the way down just to see a copyright note. Personally, I'd
    put the footer on the bottom of the page, not at the bottom
    of the window.

    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
    Els, Sep 15, 2003
    #5
  6. ={ Advocated }=

    Nico Schuyt Guest

    ={ Advocated }= wrote:
    > "Nico Schuyt" wrote
    >> ={ Advocated }= wrote:
    >>> Hey there, i have say 20 cells in a table, say 15 of them are all
    >>> one background colour, and the other 5 arent.. I want to use css for
    >>> this, so how would i go about it?

    >>
    >> Look at the example Els made for you:
    >> http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    >> (and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)


    > This is what ive done now so far:
    > http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm


    Ehh, forgive me my ignorance, but why didn't you just started with the
    advice of Els? At least that validates.
    And don't try so hard to make everything fixed in px. I (almost) never
    specify a height but let it depend on the content.
    Also it's in fact useless: If a visitor decides to increase the font (IE
    View->Text size-> Large) your cell of 19px will be 60px or something like
    that.
    Nico
    Nico Schuyt, Sep 15, 2003
    #6
  7. "Nico Schuyt" <> wrote in message
    news:3f65ef16$0$28897$...
    > ={ Advocated }= wrote:
    > > "Nico Schuyt" wrote
    > >> ={ Advocated }= wrote:
    > >>> Hey there, i have say 20 cells in a table, say 15 of them are all
    > >>> one background colour, and the other 5 arent.. I want to use css for
    > >>> this, so how would i go about it?
    > >>
    > >> Look at the example Els made for you:
    > >> http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    > >> (and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)

    >
    > > This is what ive done now so far:
    > > http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm

    >
    > Ehh, forgive me my ignorance, but why didn't you just started with the
    > advice of Els? At least that validates.
    > And don't try so hard to make everything fixed in px. I (almost) never
    > specify a height but let it depend on the content.
    > Also it's in fact useless: If a visitor decides to increase the font (IE
    > View->Text size-> Large) your cell of 19px will be 60px or something like
    > that.
    > Nico
    >
    >


    Some of my cells dont have any text, just images etc for the styling.. And
    mine is virtually the same as ells, except i use external css files instead
    of in the html doc, and i wanted to do it myself
    ={ Advocated }=, Sep 15, 2003
    #7
  8. ={ Advocated }=

    Els Guest

    ={ Advocated }= wrote:

    > "Nico Schuyt" <> wrote in message
    > news:3f65ef16$0$28897$...
    >
    >>={ Advocated }= wrote:
    >>
    >>>"Nico Schuyt" wrote
    >>>
    >>>>={ Advocated }= wrote:
    >>>>
    >>>>>Hey there, i have say 20 cells in a table, say 15 of them are all
    >>>>>one background colour, and the other 5 arent.. I want to use css for
    >>>>>this, so how would i go about it?
    >>>>
    >>>>Look at the example Els made for you:
    >>>>http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    >>>>(and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)

    >>
    >>>This is what ive done now so far:
    >>>http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm

    >>
    >>Ehh, forgive me my ignorance, but why didn't you just started with the
    >>advice of Els? At least that validates.
    >>And don't try so hard to make everything fixed in px. I (almost) never
    >>specify a height but let it depend on the content.
    >>Also it's in fact useless: If a visitor decides to increase the font (IE
    >>View->Text size-> Large) your cell of 19px will be 60px or something like
    >>that.

    >
    > Some of my cells dont have any text, just images etc for the styling..

    Which means you don't have to put any height in it, the
    image will take care of the height of that particular cell :)

    > And mine is virtually the same as ells, except i use external css files instead
    > of in the html doc,


    I would too, I just put them in the <head>, to change it
    easily. After everything works, I move the whole lot to an
    external stylesheet.

    > and i wanted to do it myself


    Fair enough, if you just copy what others do, you won't
    understand what you did. (I did use some javascript that
    way, and I still don't know what it does and why ;-))
    But do what I did: take out from the html everything that
    can be done with css, and have the lot validated before you
    move to the next step.


    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
    Els, Sep 15, 2003
    #8
  9. ={ Advocated }=

    Isofarro Guest

    Isofarro, Sep 15, 2003
    #9
  10. "Isofarro" <> wrote in message
    news:...
    > ={ Advocated }= wrote:
    >
    > > Hey there, i have say 20 cells in a table, say 15 of them are all one
    > > background colour, and the other 5 arent..

    >
    > Is there a reason why 5 cells should have a different background colour

    than
    > the others. Are they more important or less important than the other 15
    > cells?
    >
    >
    > --
    > Iso.
    > FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
    > Recommended Hosting: http://www.affordablehost.com/
    > Web Design Tutorial: http://www.sitepoint.com/article/1010


    Well they are different colours because thats the way i want them, else it
    would be a plain site with one colour
    ={ Advocated }=, Sep 15, 2003
    #10
  11. ={ Advocated }= wrote:
    > "Isofarro" <> wrote in message
    > news:...
    >> ={ Advocated }= wrote:
    >>
    >>> Hey there, i have say 20 cells in a table, say 15 of them are all
    >>> one background colour, and the other 5 arent..

    >>
    >> Is there a reason why 5 cells should have a different background
    >> colour than the others. Are they more important or less important
    >> than the other 15 cells?
    >>

    >
    > Well they are different colours because thats the way i want them,
    > else it would be a plain site with one colour


    what does it do? the colour, what does it signify?

    --
    William Tasso - http://WilliamTasso.com
    William Tasso, Sep 15, 2003
    #11
  12. "William Tasso" <> wrote in message
    news:bk5eud$os5f5$-berlin.de...
    > ={ Advocated }= wrote:
    > > "Isofarro" <> wrote in message
    > > news:...
    > >> ={ Advocated }= wrote:
    > >>
    > >>> Hey there, i have say 20 cells in a table, say 15 of them are all
    > >>> one background colour, and the other 5 arent..
    > >>
    > >> Is there a reason why 5 cells should have a different background
    > >> colour than the others. Are they more important or less important
    > >> than the other 15 cells?
    > >>

    > >
    > > Well they are different colours because thats the way i want them,
    > > else it would be a plain site with one colour

    >
    > what does it do? the colour, what does it signify?
    >
    > --
    > William Tasso - http://WilliamTasso.com
    >
    >


    because thats how i want it, end of discussion
    ={ Advocated }=, Sep 15, 2003
    #12
  13. "Els" <> wrote in message
    news:bk4tpm$p7v$...
    > ={ Advocated }= wrote:
    >
    > > "Nico Schuyt" <> wrote in message
    > > news:3f65ef16$0$28897$...
    > >
    > >>={ Advocated }= wrote:
    > >>
    > >>>"Nico Schuyt" wrote
    > >>>
    > >>>>={ Advocated }= wrote:
    > >>>>
    > >>>>>Hey there, i have say 20 cells in a table, say 15 of them are all
    > >>>>>one background colour, and the other 5 arent.. I want to use css for
    > >>>>>this, so how would i go about it?
    > >>>>
    > >>>>Look at the example Els made for you:
    > >>>>http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    > >>>>(and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)
    > >>
    > >>>This is what ive done now so far:
    > >>>http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm
    > >>
    > >>Ehh, forgive me my ignorance, but why didn't you just started with the
    > >>advice of Els? At least that validates.
    > >>And don't try so hard to make everything fixed in px. I (almost) never
    > >>specify a height but let it depend on the content.
    > >>Also it's in fact useless: If a visitor decides to increase the font (IE
    > >>View->Text size-> Large) your cell of 19px will be 60px or something

    like
    > >>that.

    > >
    > > Some of my cells dont have any text, just images etc for the styling..

    > Which means you don't have to put any height in it, the
    > image will take care of the height of that particular cell :)
    >
    > > And mine is virtually the same as ells, except i use external css files

    instead
    > > of in the html doc,

    >
    > I would too, I just put them in the <head>, to change it
    > easily. After everything works, I move the whole lot to an
    > external stylesheet.
    >
    > > and i wanted to do it myself

    >
    > Fair enough, if you just copy what others do, you won't
    > understand what you did. (I did use some javascript that
    > way, and I still don't know what it does and why ;-))
    > But do what I did: take out from the html everything that
    > can be done with css, and have the lot validated before you
    > move to the next step.
    >
    >
    > --
    > Els
    >
    > Mente humana é como pára-quedas; funciona melhor aberta.
    >


    Ive been putting most things into css now, yet my page looks totally, whats
    the word, BAD! :S
    if you see it in IE:
    http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm
    you will see a gap between the 2 logo's which i cant work out, and if you
    look at the page in netscape, there is no gap, yet all the extra
    things(those lines, on the lighter orange) are just totally not aligned,
    like they are supposed to be, with the css file.. Im going from bad to worse
    :S

    Help would be apreciated
    ={ Advocated }=, Sep 15, 2003
    #13
  14. ={ Advocated }= wrote:
    > because thats how i want it, end of discussion


    The others were asking because there are different techniques that are
    appropriate for differtent scenarios:

    1. You want the top row of a table to be a different colour because it is
    the row headings.

    Solution: Structure your table so that row headings use <th> instead of
    <td> and then style th and td differently in your style sheet.

    2. You want to point out that certain listings are more significant than
    others.

    Solution: Wrap the contents of the table cells in <strong>...</strong>
    tags and then style strong with display:block; height: 100%;
    color:whatever; background-color: whatever;.

    3. You want to change the background colour for purely presentational
    desires.

    Solution: set a class for the table cells you want and then style this
    class in CSS.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
    Toby A Inkster, Sep 16, 2003
    #14
  15. ={ Advocated }=

    rf Guest

    "Toby A Inkster" <> wrote in message
    news:p...
    > ={ Advocated }= wrote:
    > > because thats how i want it, end of discussion

    >
    > The others were asking because there are different techniques that are
    > appropriate for differtent scenarios:
    >


    <snip scenarios>

    It is also possible to construct a style rule that selects a <tr>.

    Cheers
    Richard.
    rf, Sep 16, 2003
    #15
  16. ={ Advocated }= wrote:

    [CSS]

    >
    > Help would be apreciated


    I daresay it might be.

    however, I understand from another of your posts in this thread that you are
    no longer interested.

    <q>end of discussion</q src="={ Advocated }=">

    Good bye.
    --
    William Tasso - http://WilliamTasso.com
    William Tasso, Sep 16, 2003
    #16
  17. ={ Advocated }=

    Els Guest

    ={ Advocated }= wrote:
    > "Els" <> wrote in message
    > news:bk4tpm$p7v$...
    >>={ Advocated }= wrote:
    >>>"Nico Schuyt" <> wrote in message
    >>>news:3f65ef16$0$28897$...
    >>>>={ Advocated }= wrote:
    >>>>>"Nico Schuyt" wrote
    >>>>>>={ Advocated }= wrote:
    >>>>>>
    >>>>>>>Hey there, i have say 20 cells in a table, say 15 of them are all
    >>>>>>>one background colour, and the other 5 arent.. I want to use css for
    >>>>>>>this, so how would i go about it?
    >>>>>>
    >>>>>>Look at the example Els made for you:
    >>>>>>http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    >>>>>>(and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm :)
    >>>>
    >>>>>This is what ive done now so far:
    >>>>>http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm
    >>>>
    >>>>Ehh, forgive me my ignorance, but why didn't you just started with the
    >>>>advice of Els? At least that validates.
    >>>>And don't try so hard to make everything fixed in px. I (almost) never
    >>>>specify a height but let it depend on the content.
    >>>>Also it's in fact useless: If a visitor decides to increase the font (IE
    >>>>View->Text size-> Large) your cell of 19px will be 60px or something like
    >>>>that.
    >>>
    >>>Some of my cells dont have any text, just images etc for the styling..

    >>
    >>Which means you don't have to put any height in it, the
    >>image will take care of the height of that particular cell :)
    >>
    >>>And mine is virtually the same as ells, except i use external css files instead
    >>>of in the html doc,

    >>
    >>I would too, I just put them in the <head>, to change it
    >>easily. After everything works, I move the whole lot to an
    >>external stylesheet.
    >>
    >>>and i wanted to do it myself

    >>
    >>Fair enough, if you just copy what others do, you won't
    >>understand what you did. (I did use some javascript that
    >>way, and I still don't know what it does and why ;-))
    >>But do what I did: take out from the html everything that
    >>can be done with css, and have the lot validated before you
    >>move to the next step.
    >>

    > Ive been putting most things into css now, yet my page looks totally, whats
    > the word, BAD! :S
    > if you see it in IE:
    > http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm


    What I see now (22.13 hrs CET) is not what it looked like
    when you wrote this message, is it? All I see now, is the
    images, (no logo's, therefore: no gap) and some text white
    on white, which I don't see if I don't hightlight it.
    Looking at the source code, I see that you still have
    heights in the td's, and that the various classes you
    defined, are not to be found back in the stylesheet.

    > you will see a gap between the 2 logo's which i cant work out, and if you
    > look at the page in netscape, there is no gap, yet all the extra
    > things(those lines, on the lighter orange) are just totally not aligned,
    > like they are supposed to be, with the css file.. Im going from bad to worse


    Looks more like you're going around in circles.
    Maybe you forgot to link a stylesheet to the page? All these
    classes I see in the source code, are not in toplinks.css.

    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
    Els, Sep 16, 2003
    #17
  18. "Els" <> wrote in message
    news:bk7rh7$l9d$...
    > ={ Advocated }= wrote:
    > > "Els" <> wrote in message
    > > news:bk4tpm$p7v$...
    > >>={ Advocated }= wrote:
    > >>>"Nico Schuyt" <> wrote in message
    > >>>news:3f65ef16$0$28897$...
    > >>>>={ Advocated }= wrote:
    > >>>>>"Nico Schuyt" wrote
    > >>>>>>={ Advocated }= wrote:
    > >>>>>>
    > >>>>>>>Hey there, i have say 20 cells in a table, say 15 of them are all
    > >>>>>>>one background colour, and the other 5 arent.. I want to use css

    for
    > >>>>>>>this, so how would i go about it?
    > >>>>>>
    > >>>>>>Look at the example Els made for you:
    > >>>>>>http://home.tiscali.nl/~elizabeth/advocated/newindex.html
    > >>>>>>(and my suggestion at http://www.nicoschuyt.nl/test/advocated.htm

    :)
    > >>>>
    > >>>>>This is what ive done now so far:
    > >>>>>http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm
    > >>>>
    > >>>>Ehh, forgive me my ignorance, but why didn't you just started with the
    > >>>>advice of Els? At least that validates.
    > >>>>And don't try so hard to make everything fixed in px. I (almost) never
    > >>>>specify a height but let it depend on the content.
    > >>>>Also it's in fact useless: If a visitor decides to increase the font

    (IE
    > >>>>View->Text size-> Large) your cell of 19px will be 60px or something

    like
    > >>>>that.
    > >>>
    > >>>Some of my cells dont have any text, just images etc for the styling..
    > >>
    > >>Which means you don't have to put any height in it, the
    > >>image will take care of the height of that particular cell :)
    > >>
    > >>>And mine is virtually the same as ells, except i use external css files

    instead
    > >>>of in the html doc,
    > >>
    > >>I would too, I just put them in the <head>, to change it
    > >>easily. After everything works, I move the whole lot to an
    > >>external stylesheet.
    > >>
    > >>>and i wanted to do it myself
    > >>
    > >>Fair enough, if you just copy what others do, you won't
    > >>understand what you did. (I did use some javascript that
    > >>way, and I still don't know what it does and why ;-))
    > >>But do what I did: take out from the html everything that
    > >>can be done with css, and have the lot validated before you
    > >>move to the next step.
    > >>

    > > Ive been putting most things into css now, yet my page looks totally,

    whats
    > > the word, BAD! :S
    > > if you see it in IE:
    > > http://homepage.ntlworld.com/c.jones13/Test/NewIndex.htm

    >
    > What I see now (22.13 hrs CET) is not what it looked like
    > when you wrote this message, is it? All I see now, is the
    > images, (no logo's, therefore: no gap) and some text white
    > on white, which I don't see if I don't hightlight it.
    > Looking at the source code, I see that you still have
    > heights in the td's, and that the various classes you
    > defined, are not to be found back in the stylesheet.
    >
    > > you will see a gap between the 2 logo's which i cant work out, and if

    you
    > > look at the page in netscape, there is no gap, yet all the extra
    > > things(those lines, on the lighter orange) are just totally not aligned,
    > > like they are supposed to be, with the css file.. Im going from bad to

    worse
    >
    > Looks more like you're going around in circles.
    > Maybe you forgot to link a stylesheet to the page? All these
    > classes I see in the source code, are not in toplinks.css.
    >
    > --
    > Els
    >
    > Mente humana é como pára-quedas; funciona melhor aberta.
    >


    yea sorry about that, thats my *old* page, i uploaded and overwrite the
    recent one by mistake :S
    ={ Advocated }=, Sep 16, 2003
    #18
    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. Roshawn

    Styling a control

    Roshawn, Aug 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    clintonG
    Aug 21, 2004
  2. =?Utf-8?B?Y2RiaWdncw==?=
    Replies:
    0
    Views:
    367
    =?Utf-8?B?Y2RiaWdncw==?=
    Mar 12, 2006
  3. W. Paulisse

    styling buttons without CLASS

    W. Paulisse, Sep 29, 2003, in forum: HTML
    Replies:
    4
    Views:
    1,999
    Adrienne
    Oct 1, 2003
  4. e n | c k m a

    Styling radio buttons

    e n | c k m a, Dec 2, 2003, in forum: HTML
    Replies:
    4
    Views:
    594
    e n | c k m a
    Dec 3, 2003
  5. Evertjan.
    Replies:
    6
    Views:
    123
    Evertjan.
    Apr 9, 2009
Loading...

Share This Page