Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Alternating table row colours - here's how

Featured Replies

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.