why document.getElementById("Table1")
always give me null ,
I would use the function below to will add dynamically a column to the table Table1
you have ideas ?
Thanks to better solutions. I work in aspx language
vb.net
<%@ Page Title="Mapp" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
CodeFile="Mappa.aspx.vb" Inherits="Mappa" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<style type="text/css">
.style2
{
width: 409px;
}
</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<!DOCTYPE html>
<html>
<head>
<link href="Styles/MapStile.css" rel="stylesheet" type="text/css" />
<script src="http://maps.googleapis.com/maps/api/js?"></script>
<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="true" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true" />
<script>
function displayResult() {
var table = document.getElementById("Table1");
var row = table.insertRow(-1); // change to 0 to add at the top of the table
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = "R? C1";
cell2.innerHTML = "R? C2";
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body >
<Table ID="myTable" runat="server" Width="100%">
<tr>
<td>
<Table id="Table1" runat="server" Width="100%">
<tr>
<td> ciao </td>
</tr>
<tr>
<td> ciao </td>
</tr>
<tr>
<td> ciao </td>
</tr>
<tr>
<td> ciao </td>
</tr>
</Table>
</td>
<td> <div id="googleMap" style="float:right;width:960px;border:0.5px solid blue; height:600px;"></div ></td>
</tr>
</Table>
<p><button type="button" onclick="displayResult()">Insert new row</button></p>
</body>