[uf-discuss] Marking up table rows

Scott Reynen scott at randomchaos.com
Tue Sep 4 12:11:05 PDT 2007


On Sep 4, 2007, at 12:26 PM, Charles Iliya Krempeaux wrote:

>> <tr class="vcard geo">
>>
>> or is that naughty? :-)
>
> I actually do stuff like that all the time... for things like
> signatures... it makes it very compact... for example...
>
> -- <a class="vcard fn n url" href="http://changelog.ca/">Charles Iliya
> Krempeaux</a>
>
> (It makes it so I don't have to add any extra tags... like <span>'s...
> and adding hCards is as simple as just adding classes.)
>
> I've heard some people complain because... my impression was... that
> they weren't sure how to style it... but, for example, if you wanted
> to style the url of an hCard, you could with...

Styling is only one practical problem (IE 6, still the most popular  
browser, doesn't support multi-class selectors).  More importantly,  
I'd say, is the theoretical problem of hierarchy semantics.  HTML  
defines hierarchy by nesting of elements, so that's what microformats  
do.  Putting several classes together in a single element identifies  
the content of that element as belonging to each class, but it  
doesn't tell us anything about the hierarchy of those elements.  With  
the markup above, how do we know if FN is a property of vCard or  
vCard is a property of URL?  As the number of atomic microformats and  
the ways in which they might be nested in each other expands, this  
will move from a theoretical to a practical problem.

We could certainly define our own method of establishing hierarchy,  
e.g. order of classes, but HTML already has a method that generally  
works well.  In the above example, only one extra <span> is needed to  
clarify that vCard is the container for the other properties.  With  
tables (and lists) HTML's hierarchy method doesn't work as well  
because there are nesting limits imposed (e.g. nothing is allowed  
between <tr> and <td>), but I think we should more thoroughly  
investigate alternative solutions to this problem (e.g. colgroups),  
before reinventing the wheel on hierarchy semantics.

Peace,
Scott


More information about the microformats-discuss mailing list