The forum operates in read-only mode. Please head to StackOverflow for support.
sTableBehavior += ' url(' + sBasePath + 'css/behaviors/tableresizeaspercent.htc)' ;
<public:component lightweight="true"> <public:attach event="onresizeend" onevent="resizeAsPercent()" /> <script language="javascript"> function resizeAsPercent() { // Use parent body width and current width to determine % width var oNode = this ; while ( oNode && oNode.nodeName != 'BODY' ) oNode = oNode.parentNode ; this.width = this.style.width = parseInt( ( this.offsetWidth / ( parseInt( oNode.clientWidth ) - 30 ) ) * 100 ) + '%' ; } </script> </public:component>
Re: Table resize event
You need to add a CSS behaviour to the table, and attach a handler to the resize event in there:
Example code to force table resize to use %
editor/_source/internals/fck_ie.js; add something like:
add a new file: editor/css/behaviors/tableresizeaspercent.htc
I would be grateful to anyone who can figure out how to do this in Firefox 3 too.
Cheers