Alternating row styles

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

Alternating row styles

David Sinclair
Hi,

Does anyone have any suggestions on the best way to have alternating row
styles in a table using xforms:repeat?

The only way we can see it to have 2 groups withins the repeat, each
matching either odd or even position() values.  I dont like this idea as
it involves repeating a chunk of code just to have a different class on
the <tr>.   Is there a better way?

Thanks in advance,

Dave



--
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 styles

Erik Bruchez
Administrator
David,

Unfortunately I don't know of a better way. Once we support Attribute
Value Templates (AVTs) in XHTML then we should have a better way, and
you could write:

<xhtml:tr class="{if (position() % 2 = 0) then 'foo' else 'bar'}">

But for now this won't work as XForms does not support AVTs and we do
not implement them as an extension in the XHTML yet.

-Erik

David Sinclair wrote:

> Hi,
>
> Does anyone have any suggestions on the best way to have alternating row
> styles in a table using xforms:repeat?
>
> The only way we can see it to have 2 groups withins the repeat, each
> matching either odd or even position() values.  I dont like this idea as
> it involves repeating a chunk of code just to have a different class on
> the <tr>.   Is there a better way?
>
> Thanks in advance,
>
> Dave
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
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 styles

David Sinclair

Thanks Erik,  I assumed this would be the answer but just thought I
would check first.

Dave

Erik Bruchez wrote:

> David,
>
> Unfortunately I don't know of a better way. Once we support Attribute
> Value Templates (AVTs) in XHTML then we should have a better way, and
> you could write:
>
> <xhtml:tr class="{if (position() % 2 = 0) then 'foo' else 'bar'}">
>
> But for now this won't work as XForms does not support AVTs and we do
> not implement them as an extension in the XHTML yet.
>
> -Erik
>
> David Sinclair wrote:
>> Hi,
>>
>> Does anyone have any suggestions on the best way to have alternating
>> row styles in a table using xforms:repeat?
>>
>> The only way we can see it to have 2 groups withins the repeat, each
>> matching either odd or even position() values.  I dont like this idea
>> as it involves repeating a chunk of code just to have a different
>> class on the <tr>.   Is there a better way?
>>
>> Thanks in advance,
>>
>> Dave
>
> ------------------------------------------------------------------------
>
>
> --
> 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
>  



--
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