Re: table rows using alternating style info?

Chris Croome <chris-u/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
Hi

On Sat 11-Dec-2004 at 12:32:54AM +0000, Terrence Brannon wrote:
> 
> I did not see an example of how to make alternating table rows using
> different style information (usually the variation is background
> color).
> 
> Could someone show how that is done in Petal.

I set this up the other day for some tables in MKDoc 1.8 (we must
set up viewcvs or something...), this is a extract from the
audience_list template, it's basically a matter of repeating the
row, this has the advantage that when you view the file in a browser
or WYSIWYG editor you get to see two different rows, one thing that
I don't know how to avoid is the ugly div that has to be omitted:

  <table>
    <div
      petal:omit-tag=""
      petal:repeat="audience self/audiences"
    >
      <!--? The odd row comes before the even row ?-->
      <tr 
        class="odd"
        petal:condition="true: repeat/odd"
      >
        <td>
          <!-- stuff here -->
        </td>
      </tr>
      <!--? The even row comes after the odd row ?-->
      <tr 
        class="even"
        petal:condition="true: repeat/even"
      >
        <td> 
          <!-- stuff here -->
        </td>
      </tr>
    </div>
  </table>

This example should be added to Petal POD -- there isn't an example
like this documented anywhere.

Chris

-- 
Chris Croome                               <chris-u/[email protected]>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.