Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1936358.aqSPkdTlGX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Fri, 20 Jan 2012 22:17:02 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: Shrinking the width of a WIDTH=100% table Newsgroups: comp.lang.javascript References: <8nsih7pjdunj21096qub8tnr1mluk2bons@4ax.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 41 NNTP-Posting-Date: 20 Jan 2012 22:17:03 CET NNTP-Posting-Host: fe06f905.newsspool2.arcor-online.net X-Trace: DXC=YNYYO1f91eg]BlmkiiU@BiA9EHlD;3Ycb4Fo<]lROoRa8kF I have a CGI script that builds a table with "WIDTH=100%" First of all, CGI is an obsolete technology [1]. Use server extensions or FastCGI [2] instead. > There are many paths through the code, but they all required the table > to be WIDTH=100% Second, do not do that. Learn and apply CSS instead [3]. > Now, I find that in just one of the paths, it would be better if that > WIDTH=100% had not been specified. > > Is there any JavaScript that I can insert, after the has > already been started, which will remove the effect of the WIDTH=100% Since the `width' attribute has no specified default value [4], the only proper way is to program what you would do manually: remove the attribute. elem.removeAttribute("width"); However, if you had used CSS, you could have reset the `width' property to its specified initial value [3, 5]: elem.style.width = "auto"; PointedEars ___________ [1] [2] [3] [4] [5] -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee