html5 - What HTML tag is semantically suitable for an "alternating" list with "intervals"? -
let's assume want present todo list such this:
8:00     walk dog! 8:30     clean car! 9:20     rob bank! 9:21     run dog! 22:00     have beer! 22:05   my first though use definition list, it's not great fit:
<dl>     <dt>8:00</dt>     <dd>walk dog!</dd>     <dt>8:30</dt>     <dd>clean car!</dd>     <dt>9:20</dt>     <dd>rob bank!</dd>     <dt>9:21</dt>     <dd>run dog!</dd>     <dt>22:00</dt>     <dd>have beer!</dd>     <dt>22:05</dt>     <!--<dd>missing element???</dd>--> </dl>   afaik, <dt> must followed 1 or more <dd> tags. last time (22:05) not have (non-empty-)element follow it. 
furthermore, points in time given semantically should correspond element before 1 after it, relationship lost here too.
is there other combination of html tag(s) might fit data better?
html can’t convey this. have make durations/intervals explicit (i.e., natural language).
while the time element can used durations, duration has not specific date start/end. can convey walking dog takes 30 minutes, not walk dog 8:00 8:30. nesting time elements, can (at most) hint @ that.
the equivalent non-time-related values data element, there no standardized formats, can’t convey value represents sea depth or sea depth interval.
so dl this:
<dl>     <dt><time datetime="12h 39m"><time>09:21</time> <time>22:00</time></time></dt>     <dd>run dog!</dd>     <dt><time datetime="5m"><time>22:00</time> <time>22:05</time></time></dt>     <dd>have beer!</dd> </dl>   (this allow skip times, e.g., in case didn’t run dog 09:21 22:00.)
a semantically weaker variant (e.g., if don’t want provide end time in same element) this:
    <dt><time datetime="5m"><time>22:00</time></time></dt>   in case, have provide empty dd element last time (or whatever makes sense in case).
Comments
Post a Comment