Google Maps API V3 Developer's Guide provides us with a following default code:
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
</script>
and
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
However I would like my map to be displayed in a table cell instead of a div, like this:
<table>
<tr>
<td width="700px" height="700px" id="map_canvas"></td>
</tr>
</table>
The map does not want to show the code above. Is there a way to do it?
Is there a reason you can't put the div inside the table like:
<table>
<tr>
<td width="700px" height="700px">
<div id="map_canvas" style="width:100%; height:100%"></div>
</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With