Was wondering if there was a way to alternate table row background color when links are displayed dynamincally using the <!-- BEGIN REGULAR LINKS --> comment.
the links are displayed dynmically in this simplified version:
<table> <!-- BEGIN REGULAR LINKS --> <tr background color #1> <td>All the link fields you want displayed </td> </tr> <!-- END REGULAR LINKS --> </table>
but I want the links be displayed in rows that have alternating background colors
<tr background color #1> <td>All the link fields you want displayed </td> </tr> <tr background color #2> <td>All the link fields you want displayed </td> </tr>
is there a way to do this when the links are displayed dynamically?
it sort of works however what i get is alternating row colors and then blocks of 2 or more rows that are same color as seen here .... http://wizardofchips.com
oops i forgot to generate a static copy of my directory so if anyone looked at it all they saw was table rows all one color. Ive updated it now you can see what i was talking about in my last post.... alternating colors for a couple of rows, then a block of two or three rows that are same color... looks aweful hehe
Comments on Alternating dynamic table row color
Member
Usergroup: Customer
Joined: Jan 15, 2005
Total Topics: 7
Total Comments: 20
Was wondering if there was a way to alternate table row background color when links are displayed dynamincally using the <!-- BEGIN REGULAR LINKS --> comment.
the links are displayed dynmically in this simplified version:
<table>
<!-- BEGIN REGULAR LINKS -->
<tr background color #1>
<td>All the link fields you want displayed </td>
</tr>
<!-- END REGULAR LINKS -->
</table>
but I want the links be displayed in rows that have alternating background colors
<tr background color #1>
<td>All the link fields you want displayed </td>
</tr>
<tr background color #2>
<td>All the link fields you want displayed </td>
</tr>
is there a way to do this when the links are displayed dynamically?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Some PHP,
<? if ({LINKNUMBER} % 2) { ?>
<tr background color #1>
<? } else { ?>
<tr background color #2>
<? } ?>
should do it.
Member
Usergroup: Customer
Joined: Jan 15, 2005
Total Topics: 7
Total Comments: 20
it sort of works however what i get is alternating row colors and then blocks of 2 or more rows that are same color as seen here .... http://wizardofchips.com
Member
Usergroup: Customer
Joined: Jan 15, 2005
Total Topics: 7
Total Comments: 20
oops i forgot to generate a static copy of my directory so if anyone looked at it all they saw was table rows all one color. Ive updated it now you can see what i was talking about in my last post.... alternating colors for a couple of rows, then a block of two or three rows that are same color... looks aweful hehe
Member
Usergroup: Customer
Joined: Jan 15, 2005
Total Topics: 7
Total Comments: 20
ok I fixed the output for a toplist to alternate table row colors by changing {LINKNUMBER} in Paul's example to {NUMBER} that was easy.
I suspect that {LINKNUMBER} will work fine for any output that was generated by the <!-- BEGIN REGULAR --> call in my other templates.