I figured it out, thanks to Jeffrey. I appreciated the help, you pointed me in the right direction.<div>What's really cool, is that by forcing me to not split the tags, I ended up with a much cleaner solution. It'll be even cleaner when I fix the hard coded list building :)<br>
<div><div><br><div>(defun people-and-organizations-list ()</div><div>"Creates a list of people and organizations"</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>(web-common::with-html </div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span>(:section :id "people-and-organization-list" </div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>(:a :href *add-organization-url* "Add Organization")</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span>(let ((result-list (people-and-organizations-query))</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>(columns 3))</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span>(loop for i from 0 to (list-length result-list) by 3 do</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> (people-and-organizations-row (list (nth i result-list) </div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span> (nth (+ 1 i) result-list)</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> (nth (+ 2 i) result-list))))))))</div>
</div><div><br></div><br><div class="gmail_quote">On Thu, Nov 17, 2011 at 10:19 AM, Jeffrey Cunningham <span dir="ltr"><<a href="mailto:jeffrey@jkcunningham.com">jeffrey@jkcunningham.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div><div><div class="h5">On Thu, 17 Nov 2011 07:47:32 -0800, Jim Barrows <<a href="mailto:jim.barrows@gmail.com" target="_blank">jim.barrows@gmail.com</a>> wrote:<br><br><blockquote style="margin:0 0 0.80ex;border-left:#0000ff 2px solid;padding-left:1ex">
I'm pulling records from a database, and I don't know how many I'll have. I need to display them in a 3 by X grid built in CSS. So it needs to look something like:<br clear="all"><div><div>(:div :class "row" </div>
<div> (:div :class "span-one-third" "1/3")</div><div> (:div :class "span-one-third" "1/3")</div><div> (:div :class "span-one-third" "1/3"))</div></div><div><br>
</div><div>Since I don't know how many rows are returning, I can't really hard code it like the above example.</div><div><br></div><div>I'm new to lisp, so I may just be thinking about this in the wrong way. In Java, opening a tag like this and closing it is a very common pattern. Maybe I'm just thinking too much in Java...</div>
-- <br>James A Barrows<br></blockquote><div><br></div></div></div><div>Here's one way:</div><div><br></div><div><font face="Courier New"><small>(let ((records '((1 2 3) (4 5 6) (7 8 9))))</small><small><br></small><small> (with-html-output (*standard-output* nil :indent 0)</small><small><br>
</small><small> (dolist (rec records)</small><small><br></small><small> (htm (:div :class "row"</small><small><br></small><small> (dolist (col rec)</small><small><br></small><small> (htm </small><small>(:div :class "span-one-third" (str col)))))))))</small></font></div>
<div><br></div><div>Jeff Cunningham<br><br>
</div><br><br><br></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>James A Barrows<br><br>
</div></div>