September 17, 200421 yr As many of you already know, there is no built-in way for FileMaker to alternate table row colours via CDML. I recently needed to do this, so I thought I'd offer my simple-but-easy solution as thanks for the help I've received from these forums. I hope it helps someone else. In the document head: <script language="javascript" type="text/javascript> function alternateRowColors(RecNum) { if ((RecNum % 2) > 0) { document.getElementById(RecNum).style.backgroundColor = '#FFFFFF'; } else { document.getElementById(RecNum).style.backgroundColor = '#CCCCCC'; } } </script> Then, in the HTML code for your table: <table> [FMP-Record] <tr id="[FMP-CurrentRecordNumber]"> <td> ... </td> etc </tr> <script language="javascript" type="text/javascript">alternateRowColors('[FMP-CurrentRecordNumber]')</script> [/FMP-Record] </table> There you go. I can explain how and why it works if requested, but it's probably pretty obvious to most of you. Cheers, Kevin Futter
Create an account or sign in to comment