Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: Alignment of three tables Date: Mon, 10 Jun 2013 11:16:19 -0600 Lines: 33 Message-ID: References: <9415734.fqrm2ecmqt@PointedEars.de> X-Trace: individual.net t6m5QI1/VzyxO8hgpmBCkgBtORFjn5bzVl18tFzt42A/I/tw7U Cancel-Lock: sha1:HceD8gXH6qA5z1iC9lmjldTgyuI= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Response Xref: csiph.com comp.lang.javascript:20193 To Thomas and Denis: Here is my js code below for sizing three of my five tables on my page. It works and looks great and thank you ! When viewing on a wide screen, I notice a very slight mis-alignment that I can probably cure with non-integer percentages (e.g., 6.4% ) But for now, thanks again to you both ! -Mel Smith ********************************************** function setcolwidths () { var i,j,pwidths,tables,cells,len,len2 ; pwidths = [10, 44, 23, 6, 16]; // width of columns in percentages -- 99% total tables = [getobj("ifixedheader"),getobj("icrstable"),getobj("ifixedfooter")] for (i= 0,len = tables && tables.length;i < len;++i) { for (j=0,cells = tables[i].rows[0].cells,len2 = cells.length;j < len2;++j) { cells[j].style.width = pwidths[j] + "%"; } } }