10 March 2004

Semantically Speaking: XHTML Calendar

I have been developing a Calendar control over the last few days. You can find a version of it here (at the time of writing) . This version is already out of date - since I have found a better way of binding in the data needed, and looping through the days of the month while pulling the data. This is being developed for a schedule system that I am doing for Baglan IT.

However, one of my main concerns is that the XHTML I am using at the moment does not hold enough semantic meaning. So if the CSS is removed, it still makes sense, but not that much sense. The code looks a bit like this at the moment.

<div class="pageblank"> </div> 
<div class="pageblank"> </div> 
<div class="page"> 1</div> 
<div class="page"> 2</div> 
<div class="page"> 3</div> 
<div class="page"> 5</div> 
<div class="page"> 29</div> 
<div class="page"> 30</div> 
<div class="pageblank"> </div> 
<div class="pageblank"> </div> 

The question that is bugging me is whether is can be better than this? The only better step that I can think of at the moment is using a Ordered List to display the days of the month, and carry on using empty div's to fill in the blank days of the calendar - since these days have no semantic meaning when the CSS is not applied anyway.

The code would then look something like this:

<div class="pageblank"> </div> 
<div class="pageblank"> </div> 
	<ol> 
	<li> 1</li> 
	<li> 2</li> 
	<li> 3</li> 
	<li> 4</li> 
	<li> 29</li> 
	<li> 30</li> 
	<ol> 
<div class="pageblank"> </div> 
<div class="pageblank"> </div> 

Please let me know if you can think of a better way of marking up the calendar. I am looking for the best Semantic markup.

Comments ( 8 )

  1. Hasan

    Till you tell me otherwise, I'll post if it's relevant! I can't find out where I read it, but someone else is going through this. <table> is actually the most semantically correct since a calendar is tabular data. <th> for the months, etc.
    15 March 2004 at 06:17
  2. Phil Baines

    Yeah I was thinking about that actually. Although, i feel that an ordered list will break down very niceley if the css is disabled. A table might become more confusing if the css is removed.

    If you can find the link to that discussion that would be great.

    Also, it makes it easier to write the server side control usings <div> 's or <li> 's than <tr> and <td> .

    But, yeah, I'd love to see what other people have said about it.
    16 March 2004 at 09:34
  3. phil baines

    I was just looking at this from the css-d:

    http://archivist.incutio.com/viewlist/css-discuss/21555

    It seems you are right about the most obviose markup being a table. But I really need to leave tables out of this one, so that it can also be given in a list format.

    So, what would be the next best semantic markup for a calendar??

    I think ordered list. But i am not sure.
    16 March 2004 at 09:42
  4. Hasan

    Ok, ordered lists are for ordered steps, 1: start car; 2: check mirrors etc. How 'bout an in-line list for days and floated lists for dates?
    <h2> March 2004</h2>
    <ul id="days">
    <li> Sunday</li>
    <li> Monday</li> etc...
    </ul>

    <ul class="Sundays">
    <li>  </li>
    <li> 7</li>
    <li> 14</li>
    <li> 21</li> etc...
    </ul>

    <ul class="Mondays">
    <li> 1</li>
    <li> 8</li>
    <li> 15</li> etc...
    </ul>

    What do you think?
    17 March 2004 at 04:03
  5. Hasan

    Forgot the css, you see what I mean though, I bet...
    #days {display: inline}
    ul.Sundays {float: left}
    ul.Mondays {float: left}

    It will be a beast to get the margins and paddings to work cross-browser, but who said semantics was easy?
    17 March 2004 at 04:07
  6. Hasan

    Couldn't sleep- you're right, <OL> because Mon. always follows Sun. and second Sun. of March always follows the first.
    17 March 2004 at 08:31
  7. Phil Baines

    I like the idea behind what you are saying, Hasan, but I have to consider building this XHTML on the fly using server side scripts.

    It's not just a simple calendar, becuase it have to bind to a recordset. Either using ASP/ASP.net or PHP.

    What I am saying is that strcuture would be really hard to program.

    I am not sure though, I will look at it.

    17 March 2004 at 11:23
  8. poker games

    poker games

    <h1> You can also visit some relevant pages in the field of<A HREF="http://www.e-poker-777.com/basic-rules-of-poker.html"> basic rules of poker </A> basic rules of poker <A HREF="http://www.e-poker-777.com/basic-rules-of-poker.html"> http://www.e-poker-777.com/basic-rules-of-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-games.html"> poker games </A> poker games <A HREF="http://www.e-poker-777.com/poker-games.html"> http://www.e-poker-777.com/poker-games.html</A> <br/> <A HREF="http://www.e-poker-777.com/3-card-poker.html"> 3 card poker </A> 3 card poker <A HREF="http://www.e-poker-777.com/3-card-poker.html"> http://www.e-poker-777.com/3-card-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/hold-em-poker.html"> hold em poker </A> hold em poker <A HREF="http://www.e-poker-777.com/hold-em-poker.html"> http://www.e-poker-777.com/hold-em-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/strip-poker.html"> strip poker </A> strip poker <A HREF="http://www.e-poker-777.com/strip-poker.html"> http://www.e-poker-777.com/strip-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/learn-to-play-poker.html"> learn to play poker </A> learn to play poker <A HREF="http://www.e-poker-777.com/learn-to-play-poker.html"> http://www.e-poker-777.com/learn-to-play-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/world-series-of-poker.html"> world series of poker </A> world series of poker <A HREF="http://www.e-poker-777.com/world-series-of-poker.html"> http://www.e-poker-777.com/world-series-of-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-game-download.html"> poker game download </A> poker game download <A HREF="http://www.e-poker-777.com/poker-game-download.html"> http://www.e-poker-777.com/poker-game-download.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker.html"> poker </A> poker <A HREF="http://www.e-poker-777.com/poker.html"> http://www.e-poker-777.com/poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/world-poker-tour.html"> world poker tour </A> world poker tour <A HREF="http://www.e-poker-777.com/world-poker-tour.html"> http://www.e-poker-777.com/world-poker-tour.html</A> <br/> <A HREF="http://www.e-poker-777.com/play-texas-holdem.html"> play texas holdem </A> play texas holdem <A HREF="http://www.e-poker-777.com/play-texas-holdem.html"> http://www.e-poker-777.com/play-texas-holdem.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-sites.html"> poker sites </A> poker sites <A HREF="http://www.e-poker-777.com/poker-sites.html"> http://www.e-poker-777.com/poker-sites.html</A> <br/> <A HREF="http://www.e-poker-777.com/rules-for-poker-games.html"> rules for poker games </A> rules for poker games <A HREF="http://www.e-poker-777.com/rules-for-poker-games.html"> http://www.e-poker-777.com/rules-for-poker-games.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-tables.html"> poker tables </A> poker tables <A HREF="http://www.e-poker-777.com/poker-tables.html"> http://www.e-poker-777.com/poker-tables.html</A> <br/> <A HREF="http://www.e-poker-777.com/how-to-play-texas-hold-em.html"> how to play texas hold em </A> how to play texas hold em <A HREF="http://www.e-poker-777.com/how-to-play-texas-hold-em.html"> http://www.e-poker-777.com/how-to-play-texas-hold-em.html</A> <br/> <A HREF="http://www.e-poker-777.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.e-poker-777.com/rules-for-texas-hold-em-card-game.html"> http://www.e-poker-777.com/rules-for-texas-hold-em-card-game.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-forum.html"> poker forum </A> poker forum <A HREF="http://www.e-poker-777.com/poker-forum.html"> http://www.e-poker-777.com/poker-forum.html</A> <br/> <A HREF="http://www.e-poker-777.com/online-texas-hold-em.html"> online texas hold em </A> online texas hold em <A HREF="http://www.e-poker-777.com/online-texas-hold-em.html"> http://www.e-poker-777.com/online-texas-hold-em.html</A> <br/> <A HREF="http://www.e-poker-777.com/free-poker-game-download.html"> free poker game download </A> free poker game download <A HREF="http://www.e-poker-777.com/free-poker-game-download.html"> http://www.e-poker-777.com/free-poker-game-download.html</A> <br/> <A HREF="http://www.e-poker-777.com/casino-poker.html"> casino poker </A> casino poker <A HREF="http://www.e-poker-777.com/casino-poker.html"> http://www.e-poker-777.com/casino-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/gambling-poker.html"> gambling poker </A> gambling poker <A HREF="http://www.e-poker-777.com/gambling-poker.html"> http://www.e-poker-777.com/gambling-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/online-poker-tools.html"> online poker tools </A> online poker tools <A HREF="http://www.e-poker-777.com/online-poker-tools.html"> http://www.e-poker-777.com/online-poker-tools.html</A> <br/> <A HREF="http://www.e-poker-777.com/video-poker-strategy.html"> video poker strategy </A> video poker strategy <A HREF="http://www.e-poker-777.com/video-poker-strategy.html"> http://www.e-poker-777.com/video-poker-strategy.html</A> <br/> <A HREF="http://www.e-poker-777.com/celebrity-poker.html"> celebrity poker </A> celebrity poker <A HREF="http://www.e-poker-777.com/celebrity-poker.html"> http://www.e-poker-777.com/celebrity-poker.html</A> <br/> <A HREF="http://www.e-poker-777.com/video-poker-software.html"> video poker software </A> video poker software <A HREF="http://www.e-poker-777.com/video-poker-software.html"> http://www.e-poker-777.com/video-poker-software.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-hand.html"> poker hand </A> poker hand <A HREF="http://www.e-poker-777.com/poker-hand.html"> http://www.e-poker-777.com/poker-hand.html</A> <br/> <A HREF="http://www.e-poker-777.com/poker-rules.html"> poker rules </A> poker rules <A HREF="http://www.e-poker-777.com/poker-rules.html"> http://www.e-poker-777.com/poker-rules.html</A> <br/> <A HREF="http://www.e-poker-777.com/texas-holdem-strategy.html"> texas holdem strategy </A> texas holdem strategy <A HREF="http://www.e-poker-777.com/texas-holdem-strategy.html"> http://www.e-poker-777.com/texas-holdem-strategy.html</A> <br/> <A HREF="http://www.e-poker-777.com/texas-hold-em-online.html"> texas hold em online </A> texas hold em online <A HREF="http://www.e-poker-777.com/texas-hold-em-online.html"> http://www.e-poker-777.com/texas-hold-em-online.html</A> <br/> <A HREF="http://www.e-poker-777.com/free-online-poker.html"> free online poker </A> free online poker <A HREF="http://www.e-poker-777.com/free-online-poker.html"> http://www.e-poker-777.com/free-online-poker.html</A> <br/> ... </h1>
    20 May 2005 at 07:15

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