Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ If statement to show/hide one of two tables

Posted by: zarcher Mar 27 2012, 03:10 PM

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>

Posted by: Darin McGrew Mar 27 2012, 04:08 PM

How/where are {Instrument ID} and {Last Reading} and {Target Face Pressure} defined? Is this for Tumblr?

Posted by: zarcher Mar 27 2012, 04:18 PM

QUOTE(Darin McGrew @ Mar 27 2012, 04:08 PM) *

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.

Posted by: Christian J Mar 27 2012, 04:38 PM

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

Posted by: zarcher Mar 27 2012, 05:01 PM

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?

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)