[html5] Help Digest, Vol 56, Issue 4

Laurence Gillian lau at voodoodog.com
Mon Apr 16 02:19:45 PDT 2012


Hi Brian,

Thank you for your reply.

I guess the issue is with the markup, or maybe I'm trying to do something
that can't be expressed using tables?

I have nested data and ideally I'd like the tables to be structured (and
also show) this relationship. The data structure is the same regardless of
how nested the node is.

This markup works...

<table>
 <thead>
  <tr>
   <th>name</th><th>allowed cups</th><th>cups drunk</th>
  </tr>
 </thead>
 <tbody>
 <!-- Top Containing Node(s) -->
  <tr>
   <th>Security</th><td>12</td><td>10</td>
  </tr>
  <!-- These are children of security -->
  <tr>
   <th>Chief</th><td>8</td><td>2</td>
  </tr>
  <tr>
   <th>Workers</th><td>4</td><td>8</td>
  </tr>
    <!-- And John could also have children too -->
    <tr>
     <th>John</th><td>2</td><td>4</td>
    </tr>
    <tr>
     <th>Terry</th><td>2</td><td>4</td>
    </tr>

</tbody>
</table>

But the structure doesn't represent the relationships in the data.

The reason behind wanting the code to represent the structure of the data,
is so it can be sensibly wired up to some kind of UI for editing these
grids, with changes cascading correctly.

Hope that makes a bit more sense! Thanks again! Laurie

On 15 April 2012 20:02, <help-request at lists.whatwg.org> wrote:

> Send Help mailing list submissions to
>        help at lists.whatwg.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
> or, via email, send a message with subject or body 'help' to
>        help-request at lists.whatwg.org
>
> You can reach the person managing the list at
>        help-owner at lists.whatwg.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Help digest..."
>
>
> Today's Topics:
>
>   1. Table Nesting (Laurence Gillian)
>   2. Re: Table Nesting (Brian Tremblay)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 15 Apr 2012 15:27:37 +0100
> From: Laurence Gillian <lau at voodoodog.com>
> To: help at lists.whatwg.org
> Subject: [html5] Table Nesting
> Message-ID:
>        <CAEWRofcYy+t-U0_WZdLWgZPjob7N8sLuzKnuDcPaGVzaZiBujQ at mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> I've been following WHATWG for the last few years, but normally I can
> figure out the problems! I've got a question with regards to nesting inside
> a table.
> The scenario is pulling data from a fairly complex XML document, where the
> data is nested. But let's pretend it's a bit simpler for this ;)
>
> E.g.
>
> Node
> -- Node
> -- Node
> -- Node
> -- Node
>
> Which in the real world is;
>
> Security Team A (a:allowed cups of tea = 18, b:cups of tea drunk = 14)
> -- Joe (8,2)
> -- Bob (8,8)
> -- John (2,4)
>
> The data is consistent between each node, as they use the same schema, and
> can be nested to any depth.
>
> Currently I can't see how to represent this relationship using the table
> specification?
>
> It's not possible to nest a tbody, inside a tbody, or say to use
> section/article tags to group the content as you might with say comments?
>
> Hope that makes some kind of sense! Laurie
>
> --
> Laurence Gillian
>
> VooDooDog
> 20a Brownlow Mews,
> London, WC1N 2LA
>
> lau at voodoodog.com
> www.voodoodog.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20120415/47db4e5a/attachment.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Sun, 15 Apr 2012 11:44:02 -0700
> From: Brian Tremblay <webmaster at tsmchughs.com>
> To: help at lists.whatwg.org
> Subject: Re: [html5] Table Nesting
> Message-ID: <4F8B16F2.8070205 at tsmchughs.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 4/15/12 7:27 AM, Laurence Gillian wrote:
> >
> > The scenario is pulling data from a fairly complex XML document,
> > where the data is nested.
>  >
> > Node
> > -- Node
> > -- Node
> > -- Node
> > -- Node
> >
> > Which in the real world is;
> >
> > Security Team A (a:allowed cups of tea = 18, b:cups of tea drunk = 14)
> > -- Joe (8,2)
> > -- Bob (8,8)
> > -- John (2,4)
> >
> > I can't see how to represent this relationship using the table
> > specification?
>
> I must be missing something. It seems quite straightforward to me:
>
> <table>
>  <thead>
>   <tr>
>    <th>name</th><th>allowed cups</th><th>cups drunk</th>
>   </tr>
>  </thead>
>  <tbody>
>   <tr>
>    <th>Joe</th><td>8</td><td>2</td>
>   </tr>
>   <tr>
>    <th>Bob</th><td>8</td><td>8</td>
>   </tr>
>   <tr>
>    <th>John</th><td>2</td><td>4</td>
>   </tr>
>  </tbody>
> </table>
>
>
> > It's not possible to nest a tbody, inside a tbody, or say to use
> > section/article tags to group the content
>
> No, but why would you want to? I think you need to explain the problem a
> bit more. Is the problem with the markup? Or with traversing the xml dom
> of the data?
>
> --
> Brian Tremblay
>
>
> ------------------------------
>
> _______________________________________________
> Help mailing list
> Help at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
>
>
> End of Help Digest, Vol 56, Issue 4
> ***********************************
>



-- 
Laurence Gillian

VooDooDog
20a Brownlow Mews,
London, WC1N 2LA

+44 (0)7763 849 700
+44 (0)20 7387 2049

lau at voodoodog.com
www.voodoodog.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20120416/d287517a/attachment-0001.htm>


More information about the Help mailing list