Ezilon.com - Target Your Audience, be Seen in Your Region

Coding a Calendar

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
timjpriebe's picture
DeveloperModeratorSponsor

He has: 2,666 posts

Joined: Dec 2004

I'm thinking about writing a simple little program for an online calendar. I know there are some already out there, but none of them have been quite as simple as I'd like.

Programming aside, I was wondering whether a calendar is considered proper use of a table. Or should I code all the little calendar days with CSS?

Megan's picture
Administrator

She has: 10,032 posts

Joined: Jun 1999

I would say that it is a table. Doesn't really make sense to float a bunch of divs. Divs really have no semantic meaning. The table defines a relationship between cells. Or you could do it as a list. That might be best actually. What is a calendar? It's a list of dates.... except that the dates all have to line up, which makes it more like a table.

It will be nice when the semantic web gets going and maybe we'll have a standard set of markup for stuff like this.

Abhishek Reddy's picture
Moderator

He has: 3,284 posts

Joined: Jul 2001

A calendar would be proper use of a grid, if that existed. Table is near enough.

andy206uk's picture
DeveloperModerator

He has: 1,742 posts

Joined: Jul 2002

I'm actually working on a calendar app myself and I use tables for my calendars (just make sure to use semantically correct code like etc to keep them accessible).

Andyk

Music Rants News and Reviews | My Photoblog | Blog of a Web Designer
Give a man a fish and you feed him for a day. Teach him to use the Net and he won't bother you for weeks.

JeevesBond's picture
Moderator

He has: 3,489 posts

Joined: Jun 2002

I'd agree that this is an acceptable use of a table, the clincher IMO is that it has headings. The month, and days plus anything else that should be in the heading area.

A list doesn't have any equivalent to a tables ''.

a Padded Cell our articles site!

He has: 578 posts

Joined: Jun 2004

While I agree this is definitely an acceptable use of a table (i think the simplebits guy had an article on this, can't seem to find it) I also saw someone use lists to build a calendar and this made it extremely flexible for things like mobile. I don't know what your needs are, but just thought I'd mention this.

Ayy... i'm all over the place. This is neither article i mentioned previously (I can't seem to find either) but it is relavent:

http://veerle.duoh.com/index.php/blog/comments/a_css_styled_calendar/