Challenge: Marking up the world cup
It's at the end of the world cup and it's everywhere (fotball for those that live in a cave :). It might be that I spend too much time with thinking about the web but I got this little markup issue on my mind. I'm not entirely sure how I would solve it but I have some ideas.
How would you mark up the FIFA World cup 2006 single elimination bracket? If you don't know what it is, have a look at the page linked to. It's basically 16 teams that play against eachother, one to one so half of the teams get kicked out in each step. Next step is with 8 teams, 4 teams ans so on. Pretty straight forward.
Now. Say you got contacted by FIFA to make that chart to put up on the web. Very skilled in Web Standards like you are, you start to think about what kind of data this really is. Is it a list? Ordered, unordered, nested? Is it a table, with the rounds as headers? Is it perhaps a definition list, mapping games played to teams? I don't have any 100% true answers, I'm hoping for your help there.
The second problem is of course the style. What methods would you use? There's quite a lot of boxes to place. Percentages? Can you make it zoom well?
Pasting code in comments to this blog is a bad idea (they just get messed up), so put it up on your own site instead an link to it by leaving a comment. Add a little explaination of your thinking of you wish. Can you do it?
Update: Here's my suggestion of markup and CSS for the world cup bracket.
Comments
By: Christian Tietze (#1)
Tables, either they experienced markup or are viewn in plain text mode, they look ordered anyhow. And, well, it actually is some kind of tabular data, I think.
Lists would be semantically stronger (?) but have to be written in the wrong order. One would have to nest them, therefore the final round is at the very beginning and the "round of 16" is the deepest level of all available. That might be strange, but with ordered lists the meaning could be clarified a bit (curse FIFA for giving away a third place as well, because that doesn't fit well into the hierarchy).
The problem is the brackets. Final rounds have to be on the very right of the page so every new level has to be positioned farther left (relative to its parent). Inserting bracket image things makes my head smoke now. That's really a hard task! Maybe I can figure out something during the day :S
By: Emil Stenström (#2)
By: Jesse Skinner (#3)
To actually format the thing, I think I'd highly recommend absolute or relative positioning.. or put a class on each round and try to set the padding, margins and backgrounds to line everything up okay, maybe even using em or % if you are very patient and talented.
By: Just-A-Lurker (#4)
By: Emil Stenström (#5)
By: exe (#6)
But I couldn't find a way to get the round titles at the right position.
So I ended up with, basicly, the layout Jesse describes.
Right now, the only problem is getting the matches evenly distributet vertically...
Also, of course, IE compatibility if one wants that.
By: Emil Stenström (#7)
By: exe (#8)
Anyway I made one basicly in the way Jesse describes it, but I didn't like it, too much scrolling, empty space and it got cluttered without CSS on, so I made a new one using only definition lists.
I personally think that the new one is much easier to read and friendlier for small screens and the like and hopefully the markup makes more sense :)
The links
dl+table
dl only
I will probably try and throw something better togheter, the dl+table one is just a try to make it look like the Wiki one. Which you hopefully noticed.
By: zcorpan (#9)
My reasoning is simple. The overall structure is best marked up using a table, because it has columns and headers for each column. Then rowspan can be used to achieve the "tree" relation.
The inner tables are tables because they have a caption. They could even have column headers as well ("Country", "Results"), but that would be too verbose.
The Third place table is a bit tricky. Structurally, it has the same "parents" as Final, but there are only so many dimensions a table can have. (I've thought about the axis attribute, but I'm not sure how it helps.)
I've only addressed one problem here. I'll hand over the styling to someone else.
By: Emil Stenström (#10)
@zcorpan: Interesting idea! Certainly makes styling easy, does it? ;) I'm not fully sure about representing a match as a table but I guess it could be thought of as having a "team" and "score" header like you say. Well done!
I'll try to wrap something up later tonight and post about it.
By: exe (#11)
I've updated the pages a bit so it should render more nicely in IE now, probably
By: Emil Stenström (#12)
Here's my world cup bracket markup and CSS suggestion.
I focused on the tree-like relationships of the data instead of the "vertical" relationship of "matches belonging to semi-finals" like the examples above did. Which one you want to use it up to you.
By: Ben Millard (#13)
<table>
version.This approach places each match on its own row, with columns for the properties of each match.
Each stage is grouped into a <tbody> with a row heading that spans all the rows in that stage.
The matches are ordered by the time and date they were played on, like a timetable.
The
scope
attribute is used on heading cells to make their relationships clearer to software.I think some of the other attempts may have been a bit too interested in how the result looks in their browser and creating weird markup to make it look right?
Emil, your list example is interesting...like a reversed-chronological heirarchy. It is difficult to understand without the CSS, although it looks nice with it. c{:¬)
(A preview button would be very helpful!)
By: Haralan Dobrev (#14)
By: Emil Stenström (#15)
By: Joachim (#16)
By: Emil Stenström (#17)