There's probably a way to do this in Kid, but why don't you flatten the data in 
the controller before passing it to Kid? This seems easier to me.

Barry



----- Original Message ----
From: Alex King <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, July 10, 2008 8:30:57 PM
Subject: [TurboGears] Getting kid to display a nested data structure as a flat 
one.


Hi,

I'm trying to use a data structure as follows:

Group 1
   item 1
   item 2
   item 3
Group 2
   item 2
   item 4

I want the items displayed in a table.  It is easy enough to have a 
separate table for each group, but I would like a single table in the 
output with the group names spanning the columns.

ie:

<table>

<tr>

   <th>

   ...

</tr>

<tr>

   <td colspan=n>Group 1</td>

</tr>

<tr>

   <td>Item1 part1</td>

   <td>Item1 part2</td>

   ...
</tr>
...

I have a list of groups, I need a way to iterate through the groups in 
kid without producing an html output element.  The child nodes must be 
visible though.

Why I am trying to do this is because I want to have the table widths 
the same between the different groups.  I could do it with by fixing the 
width of the tables, but I'd prefer not to do that if possible.

Any ideas?

Cheers,
Alex

-- 
Alex King    Linuxworks
Phone:   +64 3 473 1611
Mobile:  +64 21 410 420




      
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to