Alternating row tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Alternating row tags

Henrik Pettersen
All,

I am attempting to display a table with alternating row colors. I intend to do this by alternating the class name of the table rows, like this:

<tr class="even">...</tr>
<tr class="odd">...</tr>
<tr class="even">...</tr>
<tr class="odd">...</tr>
<tr class="even">...</tr>
<tr class="odd">...</tr>

So far, I have come up with this construction:

<xforms:repeat id="repeat-knowledgebase">
    <xforms:group ref="index('repeat-knowledgebase') mod 2 = 0">
        <xforms:output value="&lt;tr class=&#34;even&#34;&gt;" mediatype="text/html"/>
    </xforms:group>

    <xforms:group ref="index('repeat-knowledgebase') mod 2 != 0">
        <xforms:output value="&lt;tr class=&#34;odd&#34;&gt;" mediatype="text/html"/>
    </xforms:group>
...
    <xforms:output value="&lt;/tr&gt;')" mediatype="text/html"/>
</xforms:repeat>

but obviously, the @ref on xforms:group does not take a boolean value: It must be bound to a node.

Doh.

Any ideas, people? Perhaps using bind/relevant somehow?

Thanks!

Sincerely,
Henrik Pettersen
Advanced Computation Laboratory
Cancer Research UK




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Alternating row tags

Henrik Pettersen
All,

asked, and answered:
http://mail-archive.objectweb.org/ops-users/2006-09/msg00327.html

Missed that one earlier. Thanks, Erik!

Henrik

On 12/6/06, Henrik Pettersen <[hidden email]> wrote:
All,

I am attempting to display a table with alternating row colors. I intend to do this by alternating the class name of the table rows, like this:

<tr class="even">...</tr>
<tr class="odd">...</tr>
<tr class="even">...</tr>
<tr class="odd">...</tr>
<tr class="even">...</tr>
<tr class="odd">...</tr>

So far, I have come up with this construction:

<xforms:repeat id="repeat-knowledgebase">
    <xforms:group ref="index('repeat-knowledgebase') mod 2 = 0">
        <xforms:output value="&lt;tr class=&#34;even&#34;&gt;" mediatype="text/html"/>
    </xforms:group>

    <xforms:group ref="index('repeat-knowledgebase') mod 2 != 0">
        <xforms:output value="&lt;tr class=&#34;odd&#34;&gt;" mediatype="text/html"/>
    </xforms:group>
...
    <xforms:output value="&lt;/tr&gt;')" mediatype="text/html"/>
</xforms:repeat>

but obviously, the @ref on xforms:group does not take a boolean value: It must be bound to a node.

Doh.

Any ideas, people? Perhaps using bind/relevant somehow?

Thanks!

Sincerely,
Henrik Pettersen
Advanced Computation Laboratory
Cancer Research UK





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws