"Nik Coughin" <nrkn!no-spam!@woosh.co.nz> wrote:
> Contact information is a list of name=value pairs.
Maybe, in a logical sense.
> However, it is standard practise to omit the name from the name=value
> pair for some of the contact info,
Which means that it is just a list of text lines, isn't it? However it's
about "logical lines", so that a "line" might get split to two (or more)
lines if they are wider than the available width.
This is a bit problematic, since the order of the lines varies by
national practice. Sometimes the reader does not know which part is
street address, etc., especially if the address is written in a writing
system unknown to him (such as Latin letters for many, or Chinese
characters for some). But usually this does not matter since the cryptic
part is the lines of the postal address, and you normally use it just to
_copy_ it (into an envelope for example).
> Semantically, how is this marked up?
Since there is no element for address information in general in HTML, the
best approach is usually to use a semantically empty element, namely
<div>. That way, you will not give _incorrect_ semantic information, and
you don't invoke processing or display features that are related to
semantically wrong elements.
If you use <div> for each line, you will get the desired appearance
except for the "continuation lines". You can wrap it inside an outer
<div>, class it, and use CSS to handle that too:
<style type="text/css">
..address { margin: 0.5em 0 1em 2em; }
..address div { margin-left: 1em; text-indent: -1em; }
</style>
- -
<div class="address">
<div>John Smith</div>
<div>1234 Whatchamacallit St</div>
<div>Auckland, New Zealand</div>
<div>Email: <a href="mailto:dksjafkh@fjkahgjmns">
dksjafkh@fjkahgjmns</a></div>
<div>Phone: <a href="tel:+6495551234">+649 555 1234</a></div>
</div>
Why not <address>? Because it specifically means contact information for
the current page (author's address), and this is about the general case
of an address. And because <address> has some presentational
idiosyncracies in common browsers, features that are really _unsuitable_
for addresses. If it's really the author's address, you _might_ define it
as <address> but then you should add CSS to remove the idiosyncracies, at
least with address { font-style: normal; }.
> "It is a list of contact details therefore it should be a ul":
That would not be completely incorrect, but rather unnatural. The
meanings of <ul> and <ol> are rather vague, but they are meant to
correspond to an everyday notation of "list" in documents, not any
sequence. We are not supposed to put paragraphs inside <ul> markup, even
though paragraphs constitute a list in a very abstract sense (a
sequence). Moreover you would have to do your best to prevent browsers
from rendering <ul> the way that almost all browsers do by default -
a typical symptom of having missed a practical point in markup.
> "A definition list, as it is a list of items following the form of
> something=something":
A definition list is a list of _terms_ and definition data for them. You
are not defining the terms "Email", "Ph", etc. You are not saying "The
meaning of the word 'Email' is 'blahblah@blahblah'".
> Would you say it is wrong to leave the dt blank?
Is it wrong to define a term without saying what the term is?
> "A table; it is tabular data":
It can be regarded as tabular data, yes. A table can be used here. The
<table> markup is semantically empty except for the pure structure in the
sense that a table is a sequence of mutually isomorphic sequences - and
here you have something that can be regarded as a special case of that, a
sequence of pairs.
> <tr>
> <td>John Smith</td>
> </tr>
Since other rows have two cells, this should too - most logically, with
<th></th> as the first cell, but you could make it <th> </th> as a
workaround to certain browser problems.
> Markup is unweildy
Not really.
> Problem is similar to that of using a dl, we may end up with a
> tr containing a single td.
That's formally accepted but structurally unsound. An empty cell can be
used to handle this. It puts the data into the correct column.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring:
http://www.cs.tut.fi/~jkorpela/www.html