By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

Another DL usage

P: n/a
I want to express a list of items every of each has number of
properties and I want to get opinions if I would do it properly
using DL. Here's an example:

<DL>
<DT>date 1</DT>
<DD>name 1</DD>
<DD>description 1<DD>

<DT>date 2</DT>
<DD>name 2</DD>
<DD>description 2<DD>
....
</DL>

The point is that I want make stronger emphasis on the first key
property (it is a key property to the given context) using it as a
heading to the section with the following related properties. Does
it make sense/is it suitable to mark it up this way?

--
Stanimir
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Stanimir Stamenkov <s7****@netscape.net> wrote:
I want to express a list of items every of each has number of
properties and I want to get opinions if I would do it properly
using DL. Here's an example:

<DL>
<DT>date 1</DT>
<DD>name 1</DD>
<DD>description 1<DD>

<DT>date 2</DT>
<DD>name 2</DD>
<DD>description 2<DD>
...
</DL>

The point is that I want make stronger emphasis on the first key
property (it is a key property to the given context) using it as a
heading to the section with the following related properties. Does
it make sense/is it suitable to mark it up this way?


It's not a list of definitions so it is a misuse of the dl construct.
It's no worse a misuse than all the other misuses, including those in
the HTML spec.

The above actually looks like a table to me.

<table>
<tr><th>date</th><th>name</th><th>description</th></tr>
<tr><th>date 1</th><td>name 1</td><td>description 1</td></tr>
<tr><th>date 2</th><td>name 2</td><td>description 2</td></tr>
</table>

As a list the preferred markup would probably be:

<ul>
<li>
<hx>date 1</hx>
<ul>
<li>name 1</li>
<li>description 1</li>
</ul>
</li>
<li>
<hx>date 2</hx>
<ul>
<li>name 2</li>
<li>description 2</li>
</ul>
</li>
</ul>

Adjust the value of x and add CSS to suit.

cheers,
Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
Steve Pugh wrote:
It's not a list of definitions so it is a misuse of the dl construct.
It's no worse a misuse than all the other misuses, including those in
the HTML spec.
Please, expand further on that. What is so much worse in my intended
use? It is just list of definition (properties). One could argue
about my use of the DT element but I don't see nothing wrong in the
following construct:

<dl>
<dd class="key">date 1</dd>
<dd>name 1</dd>
<dd>description 1</dd>
</dl>
<dl>
<dd class="key">date 2</dd>
<dd>name 2</dd>
<dd>description 2</dd>
</dl>
The above actually looks like a table to me.

<table>
<tr><th>date</th><th>name</th><th>description</th></tr>
<tr><th>date 1</th><td>name 1</td><td>description 1</td></tr>
<tr><th>date 2</th><td>name 2</td><td>description 2</td></tr>
</table>
Eh, there are many things which could be expressed as table but no,
it is definitely not a table. It is more like the next one you
propose (this one I've thought of already):
As a list the preferred markup would probably be:

<ul>
<li>
<hx>date 1</hx>
<ul>
<li>name 1</li>
<li>description 1</li>
</ul>
</li>
<li>
<hx>date 2</hx>
<ul>
<li>name 2</li>
<li>description 2</li>
</ul>
</li>
</ul>


But then I don't want to use Hx(eading) elements. It is because I
have such structure:

<h1>
...
<h2>
...
<the-list>
...
<h2>
...
<h3>
...

H3 marks up much more general sections than the key elements in the
list (the list is equal weight to a block just as paragraph) and I
somewhat don't like to skip numbered heading element, pretty much
like it is in the ISO HTML. I could use:

<ul>
<li class="key">date 1</li>
<li>name 1</li>
<li>description 1</li>
</ul>
<ul>
<li class="key">date 2</li>
<li>name 2</li>
<li>description 2</li>
</ul>

But then it is almost (not to say exactly) identical to the example
in my first comment.

--
Stanimir
Jul 20 '05 #3

P: n/a
Stanimir Stamenkov <s7****@netscape.net> wrote:
Steve Pugh wrote:
It's not a list of definitions so it is a misuse of the dl construct.
It's no worse a misuse than all the other misuses, including those in
the HTML spec.
Please, expand further on that. What is so much worse in my intended
use?


Nothing, that is why I said that it was _not_ any worse than the otehr
misuses (such as the play dialogue example used in the spec).
It is just list of definition (properties).
Does a name and a description define the date? I don't think so.
One could argue
about my use of the DT element but I don't see nothing wrong in the
following construct:

<dl>
<dd class="key">date 1</dd>
<dd>name 1</dd>
<dd>description 1</dd>
</dl>
Now you have "defintions" that aren't defining anything. Might as well
use <div>s with appropriate CSS.
The above actually looks like a table to me.

<table>
<tr><th>date</th><th>name</th><th>description</th></tr>
<tr><th>date 1</th><td>name 1</td><td>description 1</td></tr>
<tr><th>date 2</th><td>name 2</td><td>description 2</td></tr>
</table>


Eh, there are many things which could be expressed as table but no,
it is definitely not a table.


Why not? If the same data exists for each date, and your example
implied that it did, then it's perfectly suitable to be a table.
It is more like the next one you
propose (this one I've thought of already):
As a list the preferred markup would probably be:

<ul>
<li>
<hx>date 1</hx>
<ul>
<li>name 1</li>
<li>description 1</li>
</ul>
</li>
<li>
<hx>date 2</hx>
<ul>
<li>name 2</li>
<li>description 2</li>
</ul>
</li>
</ul>
But then I don't want to use Hx(eading) elements. It is because I
have such structure:

<h1>
...
<h2>
...
<the-list>
...
<h2>
...
<h3>
...

H3 marks up much more general sections than the key elements in the
list (the list is equal weight to a block just as paragraph)


There is no rule about what H3 does or does not mark up other than
that its contents are a level 3 heading. The importance of any given
level of heading in HTML is entirely relative to its place in the
document, nothing else.

I frequently use H3s to mark up headings of individual paragraphs,
lists or tables. Then on the next page which may have more content
with greater number of sub-sections I might use H4s for the same
purpose.

If the next level of heading down is an H3 then it's the appropriate
heading to use. Use CSS to make it appear less important if that
matters to you.
and I
somewhat don't like to skip numbered heading element, pretty much
like it is in the ISO HTML. I could use:

<ul>
<li class="key">date 1</li>
<li>name 1</li>
<li>description 1</li>
</ul>
<ul>
<li class="key">date 2</li>
<li>name 2</li>
<li>description 2</li>
</ul>

But then it is almost (not to say exactly) identical to the example
in my first comment.


You can still use nested list as per my example, which does keep the
structure that each date is itself a part of a list of dates, and that
each name and description are deeper information than the date.

Just remove the <hx> from my example and use CSS appropriately:
li {font-weight: bold;}
li li {font weight: normal;}
plus indents and bullets to suit.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4

P: n/a
Steve Pugh wrote:
Stanimir Stamenkov <s7****@netscape.net> wrote:
It is just list of definition (properties).
Does a name and a description define the date? I don't think so.
One could argue
about my use of the DT element but I don't see nothing wrong in the
following construct:

<dl>
<dd class="key">date 1</dd>
<dd>name 1</dd>
<dd>description 1</dd>
</dl>


Now you have "defintions" that aren't defining anything.


I don't define "anything" explicitly just because I don't have a
title (doing just this: entitling) for the items I define, but then
I define them. I do however have a key property which I think could
be set to entitle the items:

<p>
Here's a list of dated items:</p>
<dl>
<dt>date 1</dt>
<dd>... <dd>...
<dt>date 2</dt>
<dd>... <dd>...
</dl>
Might as well
use <div>s with appropriate CSS.


DIVs do clear from duty all the semantics (and typical formatting)
other elements carry, so I would use them as last resort.
Eh, there are many things which could be expressed as table but no,
it is definitely not a table.


Why not? If the same data exists for each date, and your example
implied that it did, then it's perfectly suitable to be a table.


Because tables aren't fully implemented in browsers like Lynx and I
do want to keep simplest formating as possible while keeping
elements distinguishable. Because I have "description" property
which would take more space - a paragraph, and I don't want to put
all the properties in a (table) row (considerably narrowing the
available width for the paragraph). If I could use some advanced
(not yet implemented) CSS3 I can easily format the DL as visual table.
H3 marks up much more general sections than the key elements in the
list (the list is equal weight to a block just as paragraph)


There is no rule about what H3 does or does not mark up other than
that its contents are a level 3 heading. The importance of any given
level of heading in HTML is entirely relative to its place in the
document, nothing else.


I think the same goes for DL, DT, DD. It is much like:

<div class="chapter">
<hx>...
<p>...
<p>...
</div>
I could use:

<ul>
<li class="key">date 1</li>
<li>name 1</li>
<li>description 1</li>
</ul>
<ul>
<li class="key">date 2</li>
<li>name 2</li>
<li>description 2</li>
</ul>

But then it is almost (not to say exactly) identical to the example
in my first comment.


You can still use nested list as per my example, which does keep the
structure that each date is itself a part of a list of dates, and that
each name and description are deeper information than the date.


The properties are equal - "key" is somewhat temporary feature of
the particular property and I don't think I want to use such nested
lists. I just want to emphasize on the "key" property, how one
emphasize: using EM or STRONG to mark a whole still small part of
content, or Hx(eading) and DT (in DL) to mark the beginning of a
larger content part.

Whatever, I'll think more of the "list example" you've proposed.

--
Stanimir
Jul 20 '05 #5

P: n/a
Stanimir Stamenkov <s7****@netscape.net> wrote:
Steve Pugh wrote:
Stanimir Stamenkov <s7****@netscape.net> wrote:
It is just list of definition (properties).
Does a name and a description define the date? I don't think so.
One could argue
about my use of the DT element but I don't see nothing wrong in the
following construct:

<dl>
<dd class="key">date 1</dd>
<dd>name 1</dd>
<dd>description 1</dd>
</dl>


Now you have "defintions" that aren't defining anything.


I don't define "anything" explicitly just because I don't have a
title (doing just this: entitling) for the items I define, but then
I define them.


What are you defining in the above situation?
I do however have a key property which I think could
be set to entitle the items:

<p>
Here's a list of dated items:</p>
<dl>
<dt>date 1</dt>
<dd>... <dd>...
<dt>date 2</dt>
<dd>... <dd>...
</dl>


means the following:
Here is a list of definitions
The first term to be defined is 'date 1'
The first definition of 'date 1' is 'name 1'
The second definition of 'date 1' is 'description 1'
The second term to be defined is 'date 2'
The first definition of 'date 2' is 'name 2'
The second definition of 'date 2' is 'description 2'

Are the name and description actual definitions of the date? Could you
rewrite a sentence by replacing 'date 1' with the 'name 1' _or_
'description 1' and keep the same meaning?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #6

P: n/a
Stanimir Stamenkov <s7****@netscape.net> wrote:
I don't define "anything" explicitly just because I don't have a
title (doing just this: entitling) for the items I define, but then
I define them.


I would simplify that by saying that you don't define any terms, hence
you should not use <dl>.

What you should use depends on the structure of the real data. I think
we need a real example, instead of just a collection of "date", "name",
and "description". And I don't see why they wouldn't constitute a
table.

For example, if names identify events, the dates tell when they
happened, and the descriptions tell what really happened, then it is
surely tabular data. It would make perfect sense to consider it
columnwise too (e.g., list all dates, or sort the table by name)
and to access it by row and column. Of course, other markup might be
suitable too. In this hypothetical case, I would make the name a
heading and the description just text (paragraphs[s]) under it, and the
date might be just in <div> preceding the heading, or following it, or
floated on the left of it.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #7

P: n/a
Jukka K. Korpela wrote:
Stanimir Stamenkov <s7****@netscape.net> wrote:
I don't define "anything" explicitly just because I don't have a
title (doing just this: entitling) for the items I define, but then
I define them.


I would simplify that by saying that you don't define any terms, hence
you should not use <dl>.


Thank you, both: Jukka and Steve, for the answers.

Generally, I think you are right. It is just I need more time to
convince myself I think wrong. :-)

--
Stanimir
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.