You mean a "word wrap" / FlowLayout type of arrangement?
One idea is to have two snippets like yours, one for tr's and one for td's; and 
make you class a StatefulSnippet and initialize a 2D array there (or the 
RequestVar equivalent); and prepare the row for the td snippet in the tr 
snippet.
Another option is to use NodeSeq functions (FuncBindParam) inside one snippet 
instead of multiple snippets. So in your snippet arrange a 2D array, then bind 
say foreach:row to a function that iterates (flatMap) over the rows, binding 
foreach:col to each column of the current row (flatMap) with a NodeSeq function 
that does the bind of the cell contents.


-------------------------------------
harryh<[email protected]> wrote:


I have a List[Foo] and I want to construct a table with 10 columns and
however many rows necessary to contain all the Foos. I feel like I
should do something like so, but it's not quite right yet:

<table>
  <lift:MyPage.func>
    <td><foo:name/></td>
 </lift:MyPage.func>
</table>

def func(xhtml: NodeSeq): NodeSeq = {
  val cells: List[NodeSeq] = Foo.findAll(...).flatMap(foo => {
    bind("foo", xhtml, "name" -> foo.name)
  })

  // then reduce the list of cells putting in <tr>s in appropriate
places, but not sure how.
}



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" 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/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to