Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Problems with Tables

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #37067
    JosiahB
    Member

    Hello,

    I am relatively new to web coding and I need to create a calendar that has different colored days for different events. This is what I have so far:






    Untitled Document








    September




    Sunday

    Monday

    Tuesday

    Wednesday

    Thursday

    Friday

    Saterday































































    26 27 28 29 30 31 1
    2 3 4 5 6 7 8
    9 10 11 12 13 14 15
    16 17 18 19 20 21 22
    23 24 25 26 27 28 29
    30 1 2 3 4 5 6

    ….etc.

    What I need next is to have some code that will allow me to display information when a certain day is clicked. I tried using :active but that would crop the image/text within the square area of the specific day.

    Thanks, any help would be greatly appreciated!

    #98616
    JosiahB
    Member

    oh, something happened to all my div tags sorry…

    #98618
    Senff
    Participant

    Please select your code in the post and then hit the CODE button (the white paper with the blue thingies on it).

    #98619
    Senff
    Participant

    You should use some jQuery for that.

    Basically, first create a class called “selected”.
    When you click on any TD, remove the class “selected” from all TDs, and apply it to the one you just clicked.

    Like this: http://jsfiddle.net/DvrEB/

    Also, it’s called SatUrday.

    #98625
    JosiahB
    Member

    ok, where do I insert the jQuery?

    haha, I know I was typing fast and forgot to change it :)

    #98626
    JosiahB
    Member

    and how? sorry don’t know much about that, just some css and html :)

    #98627
    Senff
    Participant
    #98685
    JosiahB
    Member

    Hey, still kinda confused on how to insert it into my page … :(

    I tried doing this but nothing happened…

    ….


    .selected {
    background-color:green;
    }


    Untitled Document












    September




    Sunday

    Monday

    Tuesday

    Wednesday

    Thursday

    Friday

    Saterday

























    26 27 28 29 30 31 1
    2 3 4 5 6 7 8

    …..

    THANKS!!

    #98786
    Senff
    Participant

    Also, any content in a table should always be in a CELL. So when we take the first part of your code for example:





    September




    Sunday

    Monday

    ......
    Saterday






    ....
    26 27

    Should be something like this:








    ....






    September




    Sunday

    Monday

    ......
    Saterday



    26 27

    And, again, it’s SatUrday not SatErday. ;)

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.