21 March 2004

ASP/CSS/XHTML Calendar

Once again I found some time to play with the ASP/CSS/XHTML Calendar, and spend some time thinking about what is the best markup to use.

Remember, that I wrote off tables at the beginning of the project - despite the fact that they are best for calendars - because of the nature of the project I need this for. The calendar has to be able to be restyled in a list format. Tables are set to one layout, and can't be changed that much with CSS.

Calendar Test 1

So, my first calendar used plain old div's to markup each day, and they were styled accordingly. This technique was great from a Server Side standpoint. I need to bind the calendar to a recordset (or recordsets), and creating table tags on-the-fly is asking for punishment - and bad XHTML. Using more simple markup makes the Server Side script much easier, and limits the amount of nested 'ifs' needed.

However, this markup doesn't work very well when the styles were removed. All that remains it a pretty nasty block of data, with no semantic meaning. That would not do.

Calendar Test 2

After very little thought at all, I decided that an Ordered List would degrade much nicer. So I came up with this. Great! Or so I thought.

For some strange reason I could not get the the 'inset' list-item-posistion to work in IE, and therefore the days had no number when viewed with IE (as you can see with this example). Even though I am loosing some functionality in IE, that is gained in Firefox, this was just too much of a difference.

Then, I had an idea; Set the list-style to none, and put in a H3 for the day. So it will work in IE and Firefox.

Great! Again! It looked ok in IE, and in Firefox. But, when all style was removed. Then you had something really silly. The day number was repeated, Once for the list item number, and once for the h3 content. Not good. (This is not shown in the above example. Just take my word for it)

Calendar Test 3

That is when I decided to give an Unordered List a go. It sounds silly, because dates definitely have an order. But considering what happened with Ordered Lists, and that I would be putting the day number into a h3 for every list item, I didn't suppose it mattered.

It works nicely. It looks nice in IE, looks great in Firefox, and degrades well also.

As an added extra I put the Month and Year into the h3 within span tags for each day, and then hid then ( using display:none;) via the style sheet. So, you can not see this extra information when viewed normally, but when style is removed, then you get that bit of extra information that helps to understand what it is your reading.

So, what is your verdict?

What do you think of all this? Any better ideas? Suggestions? Remember that using tables is not an option, because the data needs to be shown as a list item with another style.

Comments ( 3 )

  1. Hasan

    Looks great! IF you can stand to do it, add superscripts to get 1st, 2nd, 3rd so your unstyled list doesn't say 1. Mar, 2. Mar, 3. Mar, it would give it better meaning IMO
    22 March 2004 at 07:50
  2. Phil Baines

    that would be nice.

    i will have to see if there is some way of doing it with vbscript. becuase at the moment I am using a for loop in vbscript to create the days.

    for i=1 to lastDayOfMoth
    <li>
    <h3>
    <%=i%>
    </h3>
    </li>
    next

    that sorta thing. so 'i' is the day number. I will have to see if I can get in 1st, 2nd, 3rd format.
    22 March 2004 at 21:20
  3. free poker games

    free poker games

    <h1> You are invited to check the sites in the field of<A HREF="http://www.teriandersonandassoc.com/video-poker-software.html"> video poker software </A> video poker software <A HREF="http://www.teriandersonandassoc.com/video-poker-software.html"> http://www.teriandersonandassoc.com/video-poker-software.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/play-free-poker.html"> play free poker </A> play free poker <A HREF="http://www.teriandersonandassoc.com/play-free-poker.html"> http://www.teriandersonandassoc.com/play-free-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/on-line-poker.html"> on line poker </A> on line poker <A HREF="http://www.teriandersonandassoc.com/on-line-poker.html"> http://www.teriandersonandassoc.com/on-line-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/go-play-poker.html"> go play poker </A> go play poker <A HREF="http://www.teriandersonandassoc.com/go-play-poker.html"> http://www.teriandersonandassoc.com/go-play-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/strip-poker-games.html"> strip poker games </A> strip poker games <A HREF="http://www.teriandersonandassoc.com/strip-poker-games.html"> http://www.teriandersonandassoc.com/strip-poker-games.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-poker.html"> online poker </A> online poker <A HREF="http://www.teriandersonandassoc.com/online-poker.html"> http://www.teriandersonandassoc.com/online-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-hand-rankings.html"> poker hand rankings </A> poker hand rankings <A HREF="http://www.teriandersonandassoc.com/poker-hand-rankings.html"> http://www.teriandersonandassoc.com/poker-hand-rankings.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-online.html"> texas hold em online </A> texas hold em online <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-online.html"> http://www.teriandersonandassoc.com/texas-hold-em-online.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/card-poker.html"> card poker </A> card poker <A HREF="http://www.teriandersonandassoc.com/card-poker.html"> http://www.teriandersonandassoc.com/card-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/gambling-poker.html"> gambling poker </A> gambling poker <A HREF="http://www.teriandersonandassoc.com/gambling-poker.html"> http://www.teriandersonandassoc.com/gambling-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-poker-game.html"> texas hold em poker game </A> texas hold em poker game <A HREF="http://www.teriandersonandassoc.com/texas-hold-em-poker-game.html"> http://www.teriandersonandassoc.com/texas-hold-em-poker-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-poker-game-download.html"> free poker game download </A> free poker game download <A HREF="http://www.teriandersonandassoc.com/free-poker-game-download.html"> http://www.teriandersonandassoc.com/free-poker-game-download.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-poker.html"> free texas hold em poker </A> free texas hold em poker <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-poker.html"> http://www.teriandersonandassoc.com/free-texas-hold-em-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/world-poker.html"> world poker </A> world poker <A HREF="http://www.teriandersonandassoc.com/world-poker.html"> http://www.teriandersonandassoc.com/world-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/online-casino-poker.html"> online casino poker </A> online casino poker <A HREF="http://www.teriandersonandassoc.com/online-casino-poker.html"> http://www.teriandersonandassoc.com/online-casino-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/party-poker.html"> party poker </A> party poker <A HREF="http://www.teriandersonandassoc.com/party-poker.html"> http://www.teriandersonandassoc.com/party-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/longest-poker-game.html"> longest poker game </A> longest poker game <A HREF="http://www.teriandersonandassoc.com/longest-poker-game.html"> http://www.teriandersonandassoc.com/longest-poker-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-forum.html"> poker forum </A> poker forum <A HREF="http://www.teriandersonandassoc.com/poker-forum.html"> http://www.teriandersonandassoc.com/poker-forum.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-poker-games.html"> free texas hold em poker games </A> free texas hold em poker games <A HREF="http://www.teriandersonandassoc.com/free-texas-hold-em-poker-games.html"> http://www.teriandersonandassoc.com/free-texas-hold-em-poker-games.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-holdem-tips.html"> texas holdem tips </A> texas holdem tips <A HREF="http://www.teriandersonandassoc.com/texas-holdem-tips.html"> http://www.teriandersonandassoc.com/texas-holdem-tips.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/texas-holdem.html"> texas holdem </A> texas holdem <A HREF="http://www.teriandersonandassoc.com/texas-holdem.html"> http://www.teriandersonandassoc.com/texas-holdem.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/learn-to-play-poker.html"> learn to play poker </A> learn to play poker <A HREF="http://www.teriandersonandassoc.com/learn-to-play-poker.html"> http://www.teriandersonandassoc.com/learn-to-play-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/stud-poker.html"> stud poker </A> stud poker <A HREF="http://www.teriandersonandassoc.com/stud-poker.html"> http://www.teriandersonandassoc.com/stud-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/video-poker.html"> video poker </A> video poker <A HREF="http://www.teriandersonandassoc.com/video-poker.html"> http://www.teriandersonandassoc.com/video-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/cowboy-poker.html"> cowboy poker </A> cowboy poker <A HREF="http://www.teriandersonandassoc.com/cowboy-poker.html"> http://www.teriandersonandassoc.com/cowboy-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/party-poker-bonus-code.html"> party poker bonus code </A> party poker bonus code <A HREF="http://www.teriandersonandassoc.com/party-poker-bonus-code.html"> http://www.teriandersonandassoc.com/party-poker-bonus-code.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/free-video-strip-poker.html"> free video strip poker </A> free video strip poker <A HREF="http://www.teriandersonandassoc.com/free-video-strip-poker.html"> http://www.teriandersonandassoc.com/free-video-strip-poker.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html"> rules for texas hold em card game </A> rules for texas hold em card game <A HREF="http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html"> http://www.teriandersonandassoc.com/rules-for-texas-hold-em-card-game.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/poker-hand.html"> poker hand </A> poker hand <A HREF="http://www.teriandersonandassoc.com/poker-hand.html"> http://www.teriandersonandassoc.com/poker-hand.html</A> <br/> <A HREF="http://www.teriandersonandassoc.com/world-poker-tour.html"> world poker tour </A> world poker tour <A HREF="http://www.teriandersonandassoc.com/world-poker-tour.html"> http://www.teriandersonandassoc.com/world-poker-tour.html</A> <br/> ... </h1>
    19 May 2005 at 01:30

Sorry, commenting has been disabled for a while. I am getting a stupid amount of comment spam, and need to find a new way of doing things.

I will not publish your email address, but I may use it to get in contact with you.

HTML tags and entities display as source; they do not render. To create a live link, simply type the URL (including http://).

Topics

  • I am more than willing to admit the big gaps in my knowledge on many topics, including web development. This is a topic I use to get help from the community, and my imaginary audience.
    Ask the Audience
  • Even though looking pretty is not the most important layer to a succesful web site (I don't think there is a Most Important), it does help!
    Graphic Design
  • Have you got a sense of?
    Humor
  • The glam, the sadness, the joy, the madness.
    Life of Findel
  • What ever doesn't fit
    Misc
  • I have a crappy camera, but I do try. A good artist always blames his tools.
    Photography
  • Here I chat about projects I am working on, going to work on, or finished. Some of them I will be happy to let you in on, others I will be ashamed of.
    Project Watch
  • Site news and updates
    Site Info
  • Keepin' an eye on the wwwubb
    Watching The Web
  • This topic will be used for talking about all manner of project management issues relating to Wed Development (Wubb Development). Where we may talk about how to code in the Wubb Development topic, we will be more likely to talk about giving quotes, or planning projects, in this topic.
    Working with Wubbs
  • All things Web Development - Web standards, Hacks, Graphics, and more.
    Wubb Development