[Petal] table rows using alternating style info?

Chris Croome chris at webarchitects.co.uk
Sat Dec 11 17:45:58 GMT 2004


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 at webarchitects.co.uk>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/   


More information about the Petal mailing list