Another DL usage

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stanimir Stamenkov

    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>descripti on 1<DD>

    <DT>date 2</DT>
    <DD>name 2</DD>
    <DD>descripti on 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
  • Steve Pugh

    #2
    Re: Another DL usage

    Stanimir Stamenkov <s7an10@netscap e.net> wrote:
    [color=blue]
    >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>descriptio n 1<DD>
    >
    ><DT>date 2</DT>
    ><DD>name 2</DD>
    ><DD>descriptio n 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?[/color]

    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>descript ion</th></tr>
    <tr><th>date 1</th><td>name 1</td><td>descript ion 1</td></tr>
    <tr><th>date 2</th><td>name 2</td><td>descript ion 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>descripti on 1</li>
    </ul>
    </li>
    <li>
    <hx>date 2</hx>
    <ul>
    <li>name 2</li>
    <li>descripti on 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 <steve@pugh.net > <http://steve.pugh.net/>

    Comment

    • Stanimir Stamenkov

      #3
      Re: Another DL usage

      Steve Pugh wrote:
      [color=blue]
      > 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.[/color]

      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">dat e 1</dd>
      <dd>name 1</dd>
      <dd>descripti on 1</dd>
      </dl>
      <dl>
      <dd class="key">dat e 2</dd>
      <dd>name 2</dd>
      <dd>descripti on 2</dd>
      </dl>
      [color=blue]
      > The above actually looks like a table to me.
      >
      > <table>
      > <tr><th>date</th><th>name</th><th>descript ion</th></tr>
      > <tr><th>date 1</th><td>name 1</td><td>descript ion 1</td></tr>
      > <tr><th>date 2</th><td>name 2</td><td>descript ion 2</td></tr>
      > </table>[/color]

      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):
      [color=blue]
      > As a list the preferred markup would probably be:
      >
      > <ul>
      > <li>
      > <hx>date 1</hx>
      > <ul>
      > <li>name 1</li>
      > <li>descripti on 1</li>
      > </ul>
      > </li>
      > <li>
      > <hx>date 2</hx>
      > <ul>
      > <li>name 2</li>
      > <li>descripti on 2</li>
      > </ul>
      > </li>
      > </ul>[/color]

      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">dat e 1</li>
      <li>name 1</li>
      <li>descripti on 1</li>
      </ul>
      <ul>
      <li class="key">dat e 2</li>
      <li>name 2</li>
      <li>descripti on 2</li>
      </ul>

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

      --
      Stanimir

      Comment

      • Steve Pugh

        #4
        Re: Another DL usage

        Stanimir Stamenkov <s7an10@netscap e.net> wrote:[color=blue]
        >Steve Pugh wrote:
        >[color=green]
        >> 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.[/color]
        >
        >Please, expand further on that. What is so much worse in my intended
        >use?[/color]

        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).
        [color=blue]
        >It is just list of definition (properties).[/color]

        Does a name and a description define the date? I don't think so.
        [color=blue]
        > 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">dat e 1</dd>
        ><dd>name 1</dd>
        ><dd>descriptio n 1</dd>
        ></dl>[/color]

        Now you have "defintions " that aren't defining anything. Might as well
        use <div>s with appropriate CSS.
        [color=blue][color=green]
        >> The above actually looks like a table to me.
        >>
        >> <table>
        >> <tr><th>date</th><th>name</th><th>descript ion</th></tr>
        >> <tr><th>date 1</th><td>name 1</td><td>descript ion 1</td></tr>
        >> <tr><th>date 2</th><td>name 2</td><td>descript ion 2</td></tr>
        >> </table>[/color]
        >
        >Eh, there are many things which could be expressed as table but no,
        >it is definitely not a table.[/color]

        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.
        [color=blue]
        >It is more like the next one you
        >propose (this one I've thought of already):
        >[color=green]
        >> As a list the preferred markup would probably be:
        >>
        >> <ul>
        >> <li>
        >> <hx>date 1</hx>
        >> <ul>
        >> <li>name 1</li>
        >> <li>descripti on 1</li>
        >> </ul>
        >> </li>
        >> <li>
        >> <hx>date 2</hx>
        >> <ul>
        >> <li>name 2</li>
        >> <li>descripti on 2</li>
        >> </ul>
        >> </li>
        >> </ul>[/color]
        >
        >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)[/color]

        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.
        [color=blue]
        >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">dat e 1</li>
        ><li>name 1</li>
        ><li>descriptio n 1</li>
        ></ul>
        ><ul>
        ><li class="key">dat e 2</li>
        ><li>name 2</li>
        ><li>descriptio n 2</li>
        ></ul>
        >
        >But then it is almost (not to say exactly) identical to the example
        >in my first comment.[/color]

        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 <steve@pugh.net > <http://steve.pugh.net/>

        Comment

        • Stanimir Stamenkov

          #5
          Re: Another DL usage

          Steve Pugh wrote:[color=blue]
          > Stanimir Stamenkov <s7an10@netscap e.net> wrote:
          >[color=green]
          >> It is just list of definition (properties).[/color]
          >
          > Does a name and a description define the date? I don't think so.
          >[color=green]
          >> 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">dat e 1</dd>
          >> <dd>name 1</dd>
          >> <dd>descripti on 1</dd>
          >> </dl>[/color]
          >
          > Now you have "defintions " that aren't defining anything.[/color]

          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>
          [color=blue]
          > Might as well
          > use <div>s with appropriate CSS.[/color]

          DIVs do clear from duty all the semantics (and typical formatting)
          other elements carry, so I would use them as last resort.
          [color=blue][color=green]
          >> Eh, there are many things which could be expressed as table but no,
          >> it is definitely not a table.[/color]
          >
          > 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.[/color]

          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 "descriptio n" 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.
          [color=blue][color=green]
          >> 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)[/color]
          >
          > 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.[/color]

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

          <div class="chapter" >
          <hx>...
          <p>...
          <p>...
          </div>
          [color=blue][color=green]
          >> I could use:
          >>
          >> <ul>
          >> <li class="key">dat e 1</li>
          >> <li>name 1</li>
          >> <li>descripti on 1</li>
          >> </ul>
          >> <ul>
          >> <li class="key">dat e 2</li>
          >> <li>name 2</li>
          >> <li>descripti on 2</li>
          >> </ul>
          >>
          >> But then it is almost (not to say exactly) identical to the example
          >> in my first comment.[/color]
          >
          > 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.[/color]

          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

          Comment

          • Steve Pugh

            #6
            Re: Another DL usage

            Stanimir Stamenkov <s7an10@netscap e.net> wrote:[color=blue]
            >Steve Pugh wrote:[color=green]
            >> Stanimir Stamenkov <s7an10@netscap e.net> wrote:
            >>[color=darkred]
            >>> It is just list of definition (properties).[/color]
            >>
            >> Does a name and a description define the date? I don't think so.
            >>[color=darkred]
            >>> 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">dat e 1</dd>
            >>> <dd>name 1</dd>
            >>> <dd>descripti on 1</dd>
            >>> </dl>[/color]
            >>
            >> Now you have "defintions " that aren't defining anything.[/color]
            >
            >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.[/color]

            What are you defining in the above situation?
            [color=blue]
            >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>[/color]

            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 <steve@pugh.net > <http://steve.pugh.net/>

            Comment

            • Jukka K. Korpela

              #7
              Re: Another DL usage

              Stanimir Stamenkov <s7an10@netscap e.net> wrote:
              [color=blue]
              > 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.[/color]

              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 "descriptio n". 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

              Comment

              • Stanimir Stamenkov

                #8
                Re: Another DL usage

                Jukka K. Korpela wrote:[color=blue]
                > Stanimir Stamenkov <s7an10@netscap e.net> wrote:
                >[color=green]
                >> 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.[/color]
                >
                > I would simplify that by saying that you don't define any terms, hence
                > you should not use <dl>.[/color]

                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

                Comment

                Working...