Originariamente inviato da Xinod
questo
var larghezza=document.getElementById("editor").width;
funziona finche' hai nel markup
<table width="640" ...>

questo
var larghezza=document.getElementById("editor").style. width;
funziona finche' hai nel markup (quindi rigorosamente nello stile in linea)
<table style="width:640px" ...>

altrimenti
var larghezza=document.getElementById("editor").offset Width;
supportato ampiamente dai browser moderni, puo' dare incongruenze in presenza di border/padding

ciao
innanzitutto grazie per la risposta Xinod

ho provato con questo codice
Codice PHP:
<html>
<
head>
<
script language="javascript">
function 
getOff()
{
    
document.getElementById('test');
    return 
x.offsetWidth;
}
alert('offsetWidth = ' getOff());
</script>
</head>
<body>
<table id="test" border="1" width="100%" height="100%">
<tr>
<td>ciao mondo</td>
</tr>
<tr>
<td>ciao mondo</td>
</tr>
<tr>
<td>ciao mondo</td>
</tr>
</table>
</body>
</html> 
ma non da risultati.. in consolle di mozilla mi ritrovo

Codice PHP:

Errore
x has no properties
File sorgente
: [url]http://localhost/test.html[/url]
Riga
da cosa può dipendere?