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

change colours of table cells

Featured Replies

is it posible to change a cells colour in a table with and if statment

what i am trying to do is if a field is a certain values i want the cell to stand out as a different colour

My approach would be to create a calculation field in the database itself, e.g.:

If the field you want to base the change on is Field_1, then define field Cell_Colour = Case(Field_1="foo", "#333333", Field_1="bar", "#666666", "#FFFFFF")

In your -Format file, modify your table like so:

<table>

<tr>

<td bgcolor="[FMP-Field:Cell_Colour]">

[FMP-Field:Field_1]

</td>

</tr>

</table>

This is a basic example, and I should point out that the bgcolor attribute is deprecated in favour of style sheets. If you take that approach, you would define the classes of the various <td> that you'd be using in your document and instead of specifying a specific RGB colour in your calculated field you would specify the name of the appropriate class.

Hope this makes sense!

P.S. I should also point out that the above example is missing the [FMP-Record]...[/FMP-Record] tags. Insert these where appropriate.

I do this quite a bit. Use an if statement in the CDML like so:

[FMP-IF: field: Wire .eq. No 5MD1 !]

<TD ALIGN=CENTER BGCOLOR="RED">

[FMP-Else]

<TD ALIGN=CENTER BGCOLOR="#AFEEEE">

[/FMP-IF]

<B>[FMP-field: Wire]</B>

</TD>

Thanks for the reassurance! I had done this before, but in claris home page, it screws up your cdml tag and just gives you the straight CDML/HTML instead, so I was sure I was doing something wrong. So I just tried it anyways (even though the tags look screwy) and sure enough...

Woo hoo!

I'm sure CHP version 4.0 would've corrected this : (

Create an account or sign in to comment

Important Information

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

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.