2

Say I have an html table:

<table border="1">
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
</table>

What is the easiest/best way to insert that html bit into a kml popup window with the python package simplekml?

CodeMonkey
  • 22,825
  • 4
  • 35
  • 75
giosans
  • 1,136
  • 1
  • 12
  • 30

1 Answers1

1

Just found it. Description and balloonstyle accept Html tags.

kml = simplekml.Kml(open=0) # open a file
pfol = kml.newfolder(name='foo',open=0) # start a folder
pol = pfol.newpoint(name= 'bar') # define a point
pol.balloonstyle.text = '<HTMLTABLE>' # insert html
pol.description = 'my point'
giosans
  • 1,136
  • 1
  • 12
  • 30