I’m not a KML or HTML expert, and this is baffling me.
I’ve created this KML file showing the locations of IMAX theaters around the world, and for some reason Google Earth formats the info boxes for some of the placemarks differently, even though the coding for all of them is identical.
Some have a vertical scroll bar, others do not. There’s no coding for table sizes that would squeeze some taller or narrower than others. There’s no common factor I can find in any of the ones that do: nothing relating to the other graphics in the box, or the amount of info, or the number of lines of text, etc.
Examples of placemarks with vertical scroll bars:
Anaheim, CA
Branson, MO
Dayton, OH
Huntsville, AL
Raleigh, NC
Tijuana, Mexico
Madrid, Spain
Most others simply fit all the info into the box without a scroll bar, which is what I want all of them to do.
I’ll probably ask this question over at the Google Earth forum, but I thought I’d check with my well-informed friends here first.
Yeah, I hadn’t tried looking at it on another monitor. On my smaller monitor I’m not seeing any scroll bars.
But there’s still an inexplicable variation in how the info boxes are displayed. Huntsville, for instance, is tall and narrow, and I don’t know why. I suspect it’s related to the scroll bar thing.
Your table has no width attribute / value so what the program is trying to do is “best fit” the data that it has into the format that it thinks best represents the data you have provided.
i.e. The various tables will look different depending on the length of the text in individual cells.
Try adding a width=“50%” to your table. That will force the table to the same size for each theatre and should make them all the same.
The labels of those located in Spain are inconsistent. If you just want the name of the city then it should be Málaga, Valencia, Oviedo and Barakaldo. I think the characters included after that are wrong. (Yel is short for Yelmo? Spn is Spain?)
I believe the one in Madrid is located at the Planetarium but that is not mentioned.
I didn’t realise there were so many Imax theaters in the world.
I will try it, but can you tell me more about how html fits the table to the data, and why some tables should be tall and narrow and others wide? Virtually all of them have addresses that are essentially similar, and the data points (screen size, etc.) in the lower row are also fairly consistent.
I intentionally left out width attributes because I thought the consistency of the data would create consistent, or at least appropriately-sized, tables. I’ve had occasions where setting a table width ended up with awkward sizing or spacing issues, and I was hoping to avoid that.
The verticle scrollbars seem to be related to the height of the application window. When I have the application maximized on a 1280x1024 monitor, there are no scrollbars on any points. But if I shrink the window, I can get scrollbars on any point.
As to the consistency of table widths, I would specify them as pixel widths instead of percentages. The icons will force the table cells to a constant size, but the address cells can be variable because the contents do not have a set width. Long lines will also wrap in an unexpected manner.
It also appears that the mime type for kml is not set properly on your server. It should be: application/vnd.google-earth.kml+xml
On your homepage, you are serving a .kmz file which downloads fine, so this might not be a big deal but I thought I should point it out if you ever plan to serve .kml files also.
One theatre has some seating information. That creates a line (until the <br>) longer than the other theatre.
The HTML will attempt make things look as nice as possible without attributes. So it sees the longer line and tries to size things such that the text wraps minimally. This causes a wider table.
If you don’t specify a table width then you’re leaving it up the browser (or GE) to determing its sizing and as you can see if changes it.
The best bet is to include sizing if you want them consistent.
Which is exactly what I want! It’s the *narrow *tables, like Huntsville, that are driving me nuts. GE is wrapping the text on that one (and others) in a way that it’s not doing with others, and I can’t figure out why. Does anyone have any ideas?
The reason why the table widths are not consistent is that you have not specified a table width. The default behavior when you do this is unpredictable.
It’s like sending a letter with nothing but a name on the envelope. Sometimes it might get delivered properly, other times not. But nobody can predict or explain what will happen because there are no set rules for dealing with this scenario.
Explicitly specifying heights and widths becomes even more important when you move away from table-based layouts. It’s just the way HTML was designed to work.
Having looked at it on several different computers, I now see that what I assumed was a consistent problem is in fact just an issue of how a particular display handles the code. So although it’s still baffling to me why some tables would show up “normally” and others would appear tall and narrow, they don’t do so on every machine, so there’s little point in worrying about it.
I may try specifying table or cell widths and see how that works, but my sense is that it could open a whole other can of worms.