[ic] Results.html and tables?

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Tue Dec 11 12:37:00 2001


-----Original Message-----
From: Paul Jordan [mailto:jordan@gishnetwork.com]
Sent: Tuesday, December 11, 2001 10:07 AM
To: Interchange list
Subject: [ic] Results.html and tables?


[snip]

>OK, my problem. My partners think my results.html page is not utilizing
>space well. As you know it loops through a search and displays them one
>below the other. I agree with them though. Is there a way to display the
>results like maybe 2 or 3 across and 2 or 3 down. You know?

Here is some code I use to create a 2 column display of people who work
at the store I am designing.  If you want 3 columns, you would have to
change the logic a bit.  Basically, if you are in column 0, you start a
new row.  If you are in the last column, you end the row and set column
back to 0.  You do end up with a blank last row, but that shouldn't be
too much of a problem.

Patrick

[set column]0[/set]
[query sql=|
     select first_name, last_name, bio
     from awt_person as p
     where person_role = 'E' and workflow_status = 'A'
           | list=1]
  [on_match]
   <tr><td colspan="2" class="awttitle">Our Employees</td></tr>
   <tr>
  [/on_match]
  [list]
    <td width="50%" valign="top">
      <span class="awtsmalltitle">[sql-param first_name] [sql-param
last_name]</span><p>[sql-param bio]</p>
    </td>
    [if scratch column == 1]
    [then]
      [set column]0[/set]
  </tr>
  <tr>
    [/then]
    [else]
      [set column]1[/set]
    [/else]
    [/if]
  [/list]
  [on_match]
  </tr>
  [/on_match]
[/query]