Hi,
I have an asset listing that displays a table, and for aesthetic mesures I would like to alternate the background colour of the tr's in the table.
Been looking at "Position Format Bodycopy" but can't quite figure out how to do it.
please can someone give me instructions on how this can be achieved?
thanks
Alternating background color between table rows in an asset listing
Jonesy
(Jonesn)
#1
gsherwood
(Greg Sherwood)
#2
There is a keyword you can use to help you with this. The keyword %asset_odd_even% will be replaced by the text "odd" or "even" depending on if the result is in an odd or even number position in the listing.
Use this keyword in your type formats to have it printed to screen and use it to set a class for your table row (like table_even and table_odd). Then you can use CSS to change the background colour of those cells. So something like:
<tr class="table_%asset_odd_even%">…</tr>