[uf-discuss] Re: hCalendar for events in a table format
Toby A Inkster
mail at tobyinkster.co.uk
Wed Mar 5 05:02:20 PST 2008
Tantek =?ISO-8859-1?B?xw==?=elik wrote:
> and the fact that we've never needed to use the axis attribute in a
> realworld tabular event example, nor has that step been implemented,
> I've removed the "Parse the 'axis'..." step.
>
> http://microformats.org/wiki/hcalendar-brainstorming#Tabular_event_calendars
A sensible move, I'd say. Though I've added a note below your change
stating that yes, it has been implemented -- by me. Though I plan on
un-implementing it now.
What could be a very handy addition to this parsing technique would
be to say that when the "headers" attribute is not present on table
cell X, parsers should:
1. For each TH element in the same row as X, if it has
a scope attribute of "row" then assume that it is a
header for X.
2. For each TH element in the same column as X, and same
TBODY as X, if it has a scope attribute of "col" then
assume that it is a header for X.
3. For each TH element in the same column as X, if it is
within that table's THEAD or TFOOT, and it has a scope
attribute of "col" then assume that it is a header for X.
This would make authoring such tables much simpler. Instead of:
<table>
<tr>
<th>Person</th>
<th id="eng"><span class="country-name">England</span></th>
<th id="sco"><span class="country-name">Scotland</span></th>
</tr>
<tr class="vcard">
<td class="fn">Gordon Brown</td>
<td class="adr" headers="eng">
<span class="street-address">10 Downing Street</span>
</td>
<td class="adr" headers="sco">
<span class="street-address">318-324 High Street</span>,
<span class="locality">Cowdenbeath</span>
</td>
</tr>
<tr class="vcard">
<td class="fn">Elizabeth Windsor</td>
<td class="adr" headers="eng">
<span class="street-address">Buckingham Palace</span>
</td>
<td class="adr" headers="sco">
<span class="street-address">Balmoral Castle</span>
</td>
</tr>
</table>
One could have:
<table>
<tr>
<th scope="col">Person</th>
<th scope="col"><span class="country-name">England</span></th>
<th scope="col"><span class="country-name">Scotland</span></th>
</tr>
<tr class="vcard">
<td class="fn">Gordon Brown</td>
<td class="adr"><span class="street-address">10 Downing Street</span></td>
<td class="adr">
<span class="street-address">318-324 High Street</span>,
<span class="locality">Cowdenbeath</span>
</td>
</tr>
<tr class="vcard">
<td class="fn">Elizabeth Windsor</td>
<td class="adr"><span class="street-address">Buckingham Palace</span></td>
<td class="adr"><span class="street-address">Balmoral Castle</span></td>
</tr>
</table>
However, implied headers like this while lowering the barrier to entry for
authors, would considerably raise the barrier for parsers -- mostly because
of colspan and rowspan, which would be an absolute pain to handle.
Although microformats' general principle is to place the burden of effort
onto parsers, implied headers via the scope attribute may shift the effort
*too* far in that direction. What do others think?
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 35 days, 18:57.]
Bottled Water
http://tobyinkster.co.uk/blog/2008/02/18/bottled-water/
More information about the microformats-discuss
mailing list