473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Another DL usage

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
7 1611
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: se7en | last post by:
okay, i cant seem to run a file with another file as an argument. e.g I want to send the file "x.met" as an argument when running the file "y.py" thanx -python newbie-
2
by: tomvr | last post by:
Hello I have noticed some 'weird' memory usage in a vb.net windows app The situation is as follows I have an app (heavy on images) with 2 forms (actually there are more forms and on starting...
188
by: christopher diggins | last post by:
I have posted a C# critique at http://www.heron-language.com/c-sharp-critique.html. To summarize I bring up the following issues : - unsafe code - attributes - garbage collection -...
26
by: Paul | last post by:
public class A { public A () { // here I would like to call the second version of _ctor, how to accomplish this ? } public A (int a, int b, int c) {
1
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows...
8
by: GeekBoy | last post by:
I understand the benefit of pushing the StateServer process onto another computer to "balance" the load and take some cpu and memory usage off the web server, but how much could it possibly help?...
2
by: Fish | last post by:
I have been researching the correct way to organize my solution so that it makes best use of VB.NET inherent ability to manage resources such as objects. My solution contains 2 projects and the...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
13
by: aum | last post by:
Hi, I'm a Python programmer, just starting to get into javascript. On reading some of the js guides, and not liking any of the OO usage patterns I saw, I've cooked up something which python...
1
by: tc | last post by:
Hi, does anyone how how I might check on the memory usage of a running application? I want to do this externally to the 'actual' application that I've written, so a small stand alone app that can...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.