If statement to show/hide one of two tables |
If statement to show/hide one of two tables |
zarcher |
Mar 27 2012, 03:10 PM
Post
#1
|
Group: Members Posts: 3 Joined: 27-March 12 Member No.: 16,802 |
This is a custom balloon for Google Maps.
Depending on the values of the cells, I want just one of these tables to appear. If there is a value for {Last Reading}, I want the first table to appear. Otherwise, the second table should appear. Please help. <div style='font-family: sans-serif'> <center> <table border="1"> <tr> <td><b>Instrument ID</b></td> <td>{Instrument ID}</td> <td><b>Last Reading</b></td> <td>{Last Reading}</td> </tr> </table> </div> </center> <b>Notes:</b> {Notes} <div style='font-family: sans-serif'> <table border="1"> <tr> <td><b>Ring #</b></td> <td>{Instrument ID}</td> <td><b>Tgt Face Pressure</b></td> <td>{Target Face Pressure}</td> </tr> </table> </div> |
Darin McGrew |
Mar 27 2012, 04:08 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
How/where are {Instrument ID} and {Last Reading} and {Target Face Pressure} defined? Is this for Tumblr?
|
zarcher |
Mar 27 2012, 04:18 PM
Post
#3
|
Group: Members Posts: 3 Joined: 27-March 12 Member No.: 16,802 |
How/where are {Instrument ID} and {Last Reading} and {Target Face Pressure} defined? Is this for Tumblr? They come from a Google Fusion Table. Open this code in a web browser to see the map. Click on any of the points to see the tables. The second table applies only to the white and gray points. The rest should use the first table. <html> <body> <center> <iframe width="1000" height="600" scrolling="no" src="https://www.google.com/fusiontables/embedviz?viz=MAP&q=select+col7+from+3349076+&h=false&lat=47.613742432089424&lng=-122.32453068355596&z=19&t=1&l=col7"></iframe> </center> </body> <html> There is not an option for using more than one info window layout so I'm trying to manipulate the code to appear differently based on the data. |
Christian J |
Mar 27 2012, 04:38 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
I assume the tables are created in the page hosted by Google? Then you may not be able to modify it with javascript due to browser security restrictions (framed pages must be on the same domain as the parent page).
|
zarcher |
Mar 27 2012, 05:01 PM
Post
#5
|
Group: Members Posts: 3 Joined: 27-March 12 Member No.: 16,802 |
It sounds like you know what you're doing, whereas, I definitely do not. Could you offer the code that would work if there were no security issues so I can just try it out?
|
Lo-Fi Version | Time is now: 30th March 2024 - 01:57 AM |