Jump to content

show innerHTML content as a table


Recommended Posts

Hello!

 

I have a map in my website and when I click on it, if there is a feature, it shows its information. This information is written by an innerHTML and currently it looks like that:

if (feature) {                var objeto = feature.getProperties(),                propiedades;                var propiedades;                content.innerHTML = "";                for (propiedades in objeto){                    content.innerHTML += propiedades + ':' + objeto[propiedades] + "<br />";                }                return container.style.display = 'block';            } else {              return container.style.display = 'none';            }

So the info is shown ok but a little untidy. So I would like to show this info with a table.

propiedades contains the name of the data and objeto[propiedades] their values.

 

Could anybody tell me how to do it or give me an example please?

 

Thank you in advance!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...