![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here is how I try to do it - but it does not work. Could someone please tell me what I am doing wrong. Every thing works ok until the line document.getElementById("main").style.left = theOffset; Thank you. function centerLayout() { var layoutWidth = 900; // set the width of the page here var bodyWidth = screen.availWidth; var theOffset = ((bodyWidth - layoutWidth)/2) - 10; if (theOffset > 0) { document.getElementById("main").style.left = theOffset; } } BODY onLoad = "centerLayout()" div id="main" ..... |
#3
| |||
| |||
|
|
reg (AT) nospam (DOT) com> wrote in message news:itr8f5p2v9r8qfc8i75m2h9qi730im7hco (AT) 4ax (DOT) com... Here is how I try to do it - but it does not work. Could someone please tell me what I am doing wrong. Every thing works ok until the line document.getElementById("main").style.left = theOffset; Thank you. function centerLayout() { var layoutWidth = 900; // set the width of the page here var bodyWidth = screen.availWidth; var theOffset = ((bodyWidth - layoutWidth)/2) - 10; if (theOffset > 0) { document.getElementById("main").style.left = theOffset; } } BODY onLoad = "centerLayout()" div id="main" ..... Hi, This solution might be frowned upon, but it's simple and it works... table cellspacing="0" cellpadding="0" width="100%" height="*" td width="*"> </td td width="900" valign="top">CONTENT GOES HERE</td td width="*"> </td /table ...hope this helps. Andy |
![]() |
| Thread Tools | |
| Display Modes | |
| |