How to Get / Set Div and Table Width / Height


Staff member
I have a Table (or a region) and want to set it's Width and Height value to another Div (or region).

The second one is actually a Ajax Indicator modal which display a loading text when the page is asynchronously post back. here is the example

<table id="MainTable">
             Content ....

<div id="Progress">
     Ajax Indocator

the following javascript didn't work

document.getElementById("Progress").style.width = document.getElementById("MainTable").style.width;
document.getElementById("Progress").style.height = document.getElementById("MainTable").style.height;

It should work both on IE and FireFox. how to correct it.

I checked some other solution in StackOverFlow but I couldn't fix it.

I'm waiting to hear from you.


Update : I use this

function SetSize(regionToChange, mainRegion) {
    $(document).ready(function() {

and I call it like

&lt;asp:Button ID="btnReset" runat="server" SkinID="Button" Text="Reset" OnClick="btnReset_OnClick" OnClientClick="SetSize('Progress', 'MainTable');" /&gt;

But it shows me an error which can not find the object


<strong>Update 2</strong> I see this error

<img src="" alt="alt text">

and in debugger I face with this

<img src="" alt="alt text">